https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72818

pmatos at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from pmatos at gcc dot gnu.org ---
octoploid in IRC pointed out that GCC warns about this with
-Wstrict-aliasing=2:
$ gcc -Wstrict-aliasing=2 -Os -c -ocast.s cast.c
cast.c: In function ‘foo’:
cast.c:1:1: warning: dereferencing type-punned pointer will break
strict-aliasing rules [-Wstrict-aliasing]
 void foo(unsigned char x){unsigned int *y=(unsigned int *)&x; *y=0x12345678;}
 ^

Closing as invalid.

Reply via email to