signals2::slot_type & g++ anti-aliasing warning
Hi,
I bumped into an issue, where g++ would give me an anti-aliasing warning
for very basic / straightforward signals2 code. consider the following
sample code:
#include <iostream>
#include
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 08 November 2010, Ákos Maróy wrote:
when compiled with the -Wall and -O2 flags, I get the following compiler warning:
... sample.cxx:13: instantiated from here /home/maroy/src/mxp/usr/include/boost/function/function_base.hpp:321: warning: dereferencing type-punned pointer will break strict-aliasing rules /home/maroy/src/mxp/usr/include/boost/function/function_base.hpp:325: warning: dereferencing type-punned pointer will break strict-aliasing rules
There's already a ticket for this against Boost.Function: https://svn.boost.org/trac/boost/ticket/4538 My guess is that it's just a gcc false positive, and can be ignored. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkzYEHgACgkQ5vihyNWuA4XylwCeO+0ZWPArB8mCjZfpCJyb4r5V zdQAn3a2keoR0lrisUlLjJmIQxSD5Z8x =ncYG -----END PGP SIGNATURE-----
On Mon, Nov 8, 2010 at 7:00 AM, Frank Mori Hess
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Monday 08 November 2010, Ákos Maróy wrote:
when compiled with the -Wall and -O2 flags, I get the following compiler warning:
... sample.cxx:13: instantiated from here /home/maroy/src/mxp/usr/include/boost/function/function_base.hpp:321: warning: dereferencing type-punned pointer will break strict-aliasing rules /home/maroy/src/mxp/usr/include/boost/function/function_base.hpp:325: warning: dereferencing type-punned pointer will break strict-aliasing rules
There's already a ticket for this against Boost.Function:
https://svn.boost.org/trac/boost/ticket/4538
My guess is that it's just a gcc false positive, and can be ignored.
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkzYEHgACgkQ5vihyNWuA4XylwCeO+0ZWPArB8mCjZfpCJyb4r5V zdQAn3a2keoR0lrisUlLjJmIQxSD5Z8x =ncYG -----END PGP SIGNATURE----- _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
The gcc guys have done a good job getting rid of these. You might try a 4.5 compiler to see if the warning goes away. Brian
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
The gcc guys have done a good job getting rid of these. You might try a 4.5 compiler to see if the warning goes away.
But avoid 4.5.0, it had a worse aliasing bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44164 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkzYGiQACgkQ5vihyNWuA4X9mQCgzQfMDh9igA2Hgs9Xia+Hq2cS 900AoKTGNVYHuaTmmEVw5NUR3QK13YOw =BOvF -----END PGP SIGNATURE-----
On 08/11/10 23:41, Frank Mori Hess wrote:
The gcc guys have done a good job getting rid of these. You might try a 4.5 compiler to see if the warning goes away.
But avoid 4.5.0, it had a worse aliasing bug:
thanks :) so far, I turned off aliasing :(
participants (3)
-
Brian Budge
-
Frank Mori Hess
-
Ákos Maróy