[Bug c/90167] invalid example in GCC documentation wrt. effective type rules
segher at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Apr 23 13:51:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90167
--- Comment #3 from Segher Boessenkool <segher at gcc dot gnu.org> ---
But you are not accessing as the union type. You do the access with the
type of one of its members. And that is UB.
The part of the standard you quote is about things like
union a_union f(double *p) { return *(union a_union *)p; }
More information about the Gcc-bugs
mailing list