------- Comment #1 from mikulas at artax dot karlin dot mff dot cuni dot cz  
2009-07-07 01:22 -------
Created an attachment (id=18145)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18145&action=view)
a bug in -Wstrict-aliasing=3

This is an example of a flaw in -Wstrict-aliasing=3 (this mode is very bad,
produces many false positives on my project and I'm wondering why is it
default?)

Gcc man page says that -Wstrict-aliasing=3 produces less false positives than
-Wstrict-aliasing=2. This is counterexample, it produces "type-punned" warning
in -Wstrict-aliasing=3 mode and doesn't warn in -Wstrict-aliasing=2. I added
(void *) casts everywhere, but they don't quash the warning.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40665

Reply via email to