GCC turns &~ into | due to undefined bit-shift without warning
Joseph Myers
joseph@codesourcery.com
Fri Mar 22 23:42:00 GMT 2019
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
joseph@codesourcery.com
More information about the Gcc
mailing list