xiaosuo@gentux test $ cat unamed.c struct test { struct { int a; }; }; int main() { struct test t1; t1.a = 0; /* it is OK */ struct test t2 = {.a = 0}; /* error */ return 0; } xiaosuo@gentux test $ gcc unamed.c unamed.c: In function 'main': unamed.c:12: error: unknown field 'a' specified in initializer
Use struct test t2 = { { .a = 0 } };
Reopening to ...
Mark as a duplicate of bug 10676 which is still open by the way. *** This bug has been marked as a duplicate of 10676 ***