|
Boost : |
Subject: [boost] Boost/utility : addressof.hpp Error due to usage of Werror flag.
From: GAURAV GUPTA (ya1gaurav_at_[hidden])
Date: 2012-09-26 01:07:42
Hi ,
While using Boost (ver 1.51.0) file "addressof.hpp" I am getting following
errors:
*Boost/1.51/Inc/boost/utility/addressof.hpp:41:69: 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?
*It works fine if i use . Is it the correct solution?*
diff -Naur a/boost/utility/addressof.hpp boost/utility/addressof.hpp
--- a/boost/utility/addressof.hpp
+++ boost/utility/addressof.hpp
@@ -37,7 +37,8 @@
static inline T * f( T & v, long )
{
return reinterpret_cast<T*>(
- &const_cast<char&>(reinterpret_cast<const volatile char &>(v)));
+ reinterpret_cast<void*>(&const_cast<char&>(reinterpret_cast<const
volatile char &>(v))));
}
-- Regards, Gaurav
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk