W
WaterWalk
I read from c99 std TC2 community draft, and found the following
statement in 6.7.2.3:
"Tw o declarations of structure, union, or enumerated types which are
in different scopes or
use different tags declare distinct types. Each declaration of a
structure, union, or
enumerated type which does not include a tag declares a distinct type."
Then consider this common practice. Struct A type is defined in a
header. This header is included by two .c files. After preprocessing,
the struct A type definition is included in those two files. According
to the description of the standard, in those two files, struct A types
definitions will be considered to be two distinct types. I don't know
if I'm right here. But this relly sounds weird.
statement in 6.7.2.3:
"Tw o declarations of structure, union, or enumerated types which are
in different scopes or
use different tags declare distinct types. Each declaration of a
structure, union, or
enumerated type which does not include a tag declares a distinct type."
Then consider this common practice. Struct A type is defined in a
header. This header is included by two .c files. After preprocessing,
the struct A type definition is included in those two files. According
to the description of the standard, in those two files, struct A types
definitions will be considered to be two distinct types. I don't know
if I'm right here. But this relly sounds weird.