The syntax for declarations structand unionwith C2011 is:
struct-or-union-specifier:
struct-or-union identifieropt { struct-declaration-list }
struct-or-union identifier
struct-or-union:
struct
union
struct-declaration-list:
struct-declaration
struct-declaration-list struct-declaration
struct-declaration:
specifier-qualifier-list struct-declarator-listopt ;
static_assert-declaration
specifier-qualifier-list:
type-specifier specifier-qualifier-listopt
type-qualifier specifier-qualifier-listopt
struct-declarator-list:
struct-declarator
struct-declarator-list , struct-declarator
struct-declarator:
declarator
declaratoropt : constant-expression
static_assert-declaration:
_Static_assert ( constant-expression , string-literal ) ;
C 2011 Online Draft , 6.7.2.1
This is pretty straightforward - every ad struct-declaration-listmust be completed with ;- there are no permissions to return a semicolon before closing }. If you somehow do not suppress it, gcc should emit diagnostics here.
Edit
Myst - gcc , - ( -Werror - ). 6.7.2.1/8. , - , } struct union, , . gcc ( ), .
Myst ,
struct foo;
struct bar {
struct foo blah;
};
struct foo , blah; , . struct foo , } , struct foo.
, - , C "" "" - , - :
5.1.1.3
1 (
),
,
undefined .
. 9)
9). , , ,
. ,
. .
, "" "", , . , .