http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53016
Richard Earnshaw <rearnsha at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID --- Comment #8 from Richard Earnshaw <rearnsha at gcc dot gnu.org> 2012-04-18 14:23:04 UTC --- Casts do not change the fact that the pointer initialized in statement I highlighted creates undefined behaviour. The fact that you are using memcpy is a red herring. >From c99: 6.3.2.3 Pointers 7) A pointer to an object or incomplete type may be converted to a pointer to a different object or incomplete type. If the resulting pointer is not correctly aligned for the pointed-to type, the behavior is undefined. ...