匿名構造体、匿名共用体(C11)

Unnamed Fields - Using the GNU Compiler Collection (GCC)
https://gcc.gnu.org/onlinedocs/gcc/Unnamed-Fields.html

フィールド名の無い構造体やユニオンを、構造体やユニオンの中に定義できる。そのメンバを参照するとき、上位の構造体直下にあるように参照できる。


struct {
int a;
union {
int b;
float c;
};
int d;
} foo;


次の形式のものは
MS拡張(-fms-extentions)を指定するとコンパイルできる。


struct a { int a; };
struct {
struct a;
};

MS拡張を指定しない場合は「declaration does not declare anything」警告が表示され、定義としては無視される。