Boost:Foreach Werror flag's problem in foreach.hpp

Hi , While using Boost (ver 1.51.0) file "foreach.hpp" I am getting following errors: Boost/1.51/Inc/boost/foreach.hpp:454:5: error: cast from 'char*' to 'std::vector<std::pair<std::basic_string<char>, std::basic_string<char> >
*' increases required alignment of target type [-Werror=cast-align] cc1plus: all warnings being treated as errors
I need to use "Werror" flag in my application. Any solution for this problem? -- Regards, Gaurav

On 09/25/2012 06:22 AM, GAURAV GUPTA wrote:
Hi ,
While using Boost (ver 1.51.0) file "foreach.hpp" I am getting following errors:
Boost/1.51/Inc/boost/foreach.hpp:454:5: error: cast from 'char*' to 'std::vector<std::pair<std::basic_string<char>, std::basic_string<char> >
*' increases required alignment of target type [-Werror=cast-align] cc1plus: all warnings being treated as errors
I need to use "Werror" flag in my application.
Any solution for this problem?
Since the code in question is a workaround for Borland, it might be a good idea to replace the code with *t on non-Borland compilers.

On 9/25/2012 10:27 AM, Mathias Gaunard wrote:
On 09/25/2012 06:22 AM, GAURAV GUPTA wrote:
Hi ,
While using Boost (ver 1.51.0) file "foreach.hpp" I am getting following errors:
Boost/1.51/Inc/boost/foreach.hpp:454:5: error: cast from 'char*' to 'std::vector<std::pair<std::basic_string<char>, std::basic_string<char> >
*' increases required alignment of target type [-Werror=cast-align] cc1plus: all warnings being treated as errors
I need to use "Werror" flag in my application.
Any solution for this problem?
Since the code in question is a workaround for Borland, it might be a good idea to replace the code with *t on non-Borland compilers.
<nod> Fixed on trunk. https://svn.boost.org/trac/boost/changeset/80702 -- Eric Niebler BoostPro Computing http://www.boostpro.com
participants (3)
-
Eric Niebler
-
GAURAV GUPTA
-
Mathias Gaunard