id summary reporter owner description type status milestone component version severity resolution keywords cc 4538 Warning: dereferencing type-punned pointer will break strict-aliasing rules Roland Bock No-Maintainer "Hi, compiling the attached example with gcc-4.4.3 (Ubuntu 10.4, 64bit) with -Wall -O3 leads to a long warning message (second attachment), culminating in {{{ boost/1.44/include/boost/function/function_base.hpp:321: warning: dereferencing type-punned pointer will break strict-aliasing rules boost/1.44/include/boost/function/function_base.hpp:325: warning: dereferencing type-punned pointer will break strict-aliasing rules }}} A way to avoid this warning is been suggested by Justin in the boost-users mailing list: http://lists.boost.org/boost-users/2010/08/61564.php Replace: {{{ reinterpret_cast(&in_buffer.data)->~Functor(); }}} with: {{{ functor_type* p = reinterpret_cast(&in_buffer.data); p->~Functor(); }}} (Second line with out_buffer, respectively) As noted by Emil Dotchevski in the thread on boost-users, it seems questionable why splitting up the original lines can get rid of the warning. So maybe a ticket should be filed for gcc by someone more knowledgeable than me. " Bugs closed Boost 1.44.0 function Boost 1.44.0 Problem fixed