This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/36360] Apparent optimization bug, possible regression



------- Comment #2 from rguenth at gcc dot gnu dot org  2008-05-28 22:25 -------
Constructs like

((struct sockaddr_in *)(&svaddr))->sin_port

violate C aliasing rules if svaddr is not of type struct sockaddr_in.

You can either use -fno-strict-aliasing or do the type-punning via
memcpy or by using unions.


-- 

rguenth at gcc dot gnu dot org changed:

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]