Is it undefined behavior to alias members like this
struct Vec3 {
union {int x,y,z;};
union {int r,g,c;};
};
If I do this
Vec3 v;
v.x = 5;
return v.r; // undefined???
I want standard wording if this is undefined. Don’t want to hear that compilers support it as an extension.