Re: No warning when breaking strict-aliasing rules despite -Wstrict-aliasing

2004-11-09 Thread Giovanni Bajo
Anders Torger <[EMAIL PROTECTED]> wrote: > I found a case where GCC does not warn even with > -Wstrict-aliasing, but makes incorrect asm code anyway. > unsigned long > hash(void *key) > { > unsigned long long u[1]; > u[0] = *(unsigned long long *)key; > return ((unsigned long *)u)

Re: No warning when breaking strict-aliasing rules despite -Wstrict-aliasing

2004-11-09 Thread Andrew Pinski
On Nov 9, 2004, at 2:23 PM, Anders Torger wrote: gcc 2.95 generates correct code. It just generates code which you expected not the code which the C standard says it is undefined (oh by the way we could wipe your HD if you invoke undefined behavior). Also a DR report says we cannot error out on u