Empty tag declarations in a block scope
create a new struct
instance in ANSI mode. The term block scope
refers to identifiers declared inside a block or list of parameter
declarations in a function definition that have meaning from their
point of declaration to the end of the block. In the ANSI mode,
it is possible to create recursive structures within an inner block.
For example:
struct x { int i; }; { /* inner scope */ struct x; struct y { struct x *xptr; }; struct x { struct y *yptr; }; }
|
In ANSI mode, the inner struct x
declaration creates a new version of the structure type which may
then be referred to by struct y.
In non-ANSI mode, the struct x;
declaration refers to the outer structure.