diff -pru include/boost/thread/win32/shared_mutex.hpp /mnt/misc/win64/mingw64-x-boost/boost_1_63_0/boost/thread/win32/shared_mutex.hpp --- include/boost/thread/win32/shared_mutex.hpp 2017-01-19 10:36:42.848867811 -0200 +++ /mnt/misc/win64/mingw64-x-boost/boost_1_63_0/boost/thread/win32/shared_mutex.hpp 2017-01-19 11:04:58.240820262 -0200 @@ -47,9 +47,14 @@ namespace boost T interlocked_compare_exchange(T* target,T new_value,T comparand) { BOOST_STATIC_ASSERT(sizeof(T)==sizeof(long)); - long const res=BOOST_INTERLOCKED_COMPARE_EXCHANGE(reinterpret_cast(target), - *reinterpret_cast(&new_value), - *reinterpret_cast(&comparand)); +#ifdef __GNUC__ + typedef long __attribute__((__may_alias__)) long_a; +#else + typedef long long_a; +#endif + long const res=BOOST_INTERLOCKED_COMPARE_EXCHANGE(reinterpret_cast(target), + *reinterpret_cast(&new_value), + *reinterpret_cast(&comparand)); return *reinterpret_cast(&res); }