On Fri, 22 Mar 2019, Andrew Pinski wrote: > "The practice of reading from a different union member than the one > most recently written to (called “type-punning”) is common. Even with > -fstrict-aliasing, type-punning is allowed, provided the memory is > accessed through the union type." > Maybe it should be more explicit saying even though the C/C++ > Langauges make it undefined, GCC makes it defined.
Type-punning is defined in C99 TC3 and later (albeit only in a non-normative footnote, but the intent is clear). -- Joseph S. Myers jos...@codesourcery.com