Say that you want this from C:
struct Foo { struct Bar { int x; int y; } bar; }; struct Foo f; f.bar = (struct Bar) { .x = 123 };
struct Foo { struct bar { int x; int y; } }; Foo f;
f.bar = { .x = 123 }; // Valid in C3
struct HelperStruct { int x; int y; } HelperStruct test = (HelperStruct)f.bar; // structural cast
struct Bar { int x, y; } struct Foo { Bar bar; };
If you need it to be first class visible outside, you declare it outside.
I believe I could live with this.
Say that you want this from C:
The struct in C3: It is correct that we don't get the inner type, but because C3 has inference for {} assignment can happen despite that: You can grab the type using typeof if you want, but interestingly there's also the possibility to use structural casts, which are valid in C3: But the normal way would be to create a named struct outside if you really need a named struct, e.g.: