------- Comment #5 from bonzini at gnu dot org 2005-11-29 17:55 ------- Frederic, "-Wstrict-aliasing" is only working for C up until 4.1 (included). Your code, rewritten to C, would issue a warning with 4.1 and earlier compilers as well. Also note that -Wstrict-aliasing does not prevent the compiler from using aliasing relationships that it has warned about.
GCC 4.2 has the same behavior as earlier versions, just does not expose it by generating wrong results, maybe because it finds some more interesting optimization to do. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25152