initialization of anonymous structures or unions in C1X
initialization of anonymous structures or unions in C1X
I have the following question: How are anonymous structures (or unions) properly initialized according to the current C1X draft? Is this legal:
struct foo { int a; struct { int i; int j; }; int b; }; struct foo f = { 1, 2, 3, 4 }; struct foo g = { 1, { 2 }, 3 };
In GCC, g.j == 0 and g.b == 3, while in tcc g.j == 3 and g.b == 0. The current draft says:
“[…]…
View On WordPress













