[Bug c/14750] type-punned pointer causes bad code

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Mar 27 08:40:00 GMT 2004


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-27 08:40 -------
The warning is correct, you are violating C89 (and C99 and C++) aliasing rules.  Use an union to get 
around this problem (note C89 says this still is undefined but GCC defines this as what you are 
expecting).

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


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



More information about the Gcc-bugs mailing list