------- Additional Comments From uros at kss-loka dot si 2004-12-29 07:49
-------
This example is from PR 16111:
#include <stdio.h>
float foo ()
{
unsigned int MASK = 0x80000000;
return (float &) MASK;
}
int main() {
printf ("%f\n", foo());
return 0;
}
'g++ -Wstrict-aliasing' does not generate a warning about breaking
strict-aliasing rules. When '(float&)MASK' is replaced with equivalent '*(float
*)&MASK', 'gcc -Wstrict-aliasing' produces expected warning.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |djp at volny dot cz
GCC build triplet|powerpc-apple-darwin7.2.0 |*-*-*
GCC host triplet|powerpc-apple-darwin7.2.0 |*-*-*
GCC target triplet|powerpc*-*-* |*-*-*
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14024