…Extend
This is hardly newsworthy. If the extensions were called ‘Jabberwocky C Extennsions’ no one would have cared. The extension allows for tagged unnamed structs inside of a struct, e.g.:
struct inner { /* ... */ }; struct outer { int value; struct inner; };Untagged?
Tag is what goes after the
structkeyword to allow referring to the struct type. Structs don’t have to have a tag. Name is what field are called. Adapting Obin’s example:struct foo { int baz; }; struct bar { struct foo qux; }; struct bar data; data.qux.baz = 0;fooandbarare tags forstruct fooandstruct bartypes respectively;bazandquxare field names; anddatais a variable name.You mean ‘unnamed’ is what’s confusing you?
Normally you can do anonymous struct/union members or struct struct/union members that are tagged structs but not anonymous.
I.e. in standard C you’d have to do either:
struct foo { int baz; }; struct bar { struct foo foo; }; ... struct bar data; data.foo.baz = 0;or:
struct bar { struct { int baz; } foo; }; ... struct bar data; data.baz = 0;but to do the following, you’d need the extension:
struct foo { int baz; }; struct bar { struct foo; }; ... struct bar data; data.baz = 0;Minor correction: Unnamed structs and unions (so your second example) are not part of C. They are GNU extensions.“ANSI C” by Kernighan and Ritchie disagrees , including that syntax (note : retranslation from Polish as that’s the language my copy is in) :
A8.3
[…]
struct-union-specifier:
, union-struct identifier ₒₚₜ{compound-declaration-list}
, union-struct identifier[…]
Specifiers of structures or unions with [a compound declaration] list, but with no label [identifier], creates a unique type; it may only be referred to in the declaration in which it is part.
Yes, but I was talking about field name, not struct tag. And up to C99 my comment was correct.
You appear to be correct.

If I understood correctly, it’s free software anyway, so why the discussion?
Because they wanted drama and clickbaity headline.






