Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

boost::bind breaks strict-aliasing rules?

Using Boost 1.43 and GCC 4.4.3, the following code

boost::bind(&SomeObject::memberFunc, this, _1));

Generates the following warning

boost/function/function_base.hpp:321: warning: dereferencing type-punned pointer will break strict-aliasing rules

What's the correct way to eliminate these warnings without setting -fno-strict-aliasing?

like image 702
Kyle Avatar asked Dec 14 '25 11:12

Kyle


1 Answers

Just for the record I had the same warning for boost::bind using GCC 4.4.3 for Google's Native Client. The warning disappeared after upgrading boost from version 1.41.0 to 1.47.0.

like image 178
Sigmund Avatar answered Dec 17 '25 01:12

Sigmund



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!