[PATCH] Fix PR c/6660

Jim Wilson wilson@redhat.com
Wed May 29 11:57:00 GMT 2002


>I quite agree that anonymous unions and structs are useful
>as documented at present.  I do not see what good this is.
>To me it looks like assigning a random meaning to a syntax
>error.

A normal struct/union member is "<type> <name>;".  An anonymous struct/union
member is "<type>;", where <type> is required to be a struct or union type.
It is an obvious extension of this to allow <type> to be a typedef name
which represents a struct or union type.  Semantically, there is no difference
between a struct/union type and its typedef name.  I agree that this results
in declarations that look funny, but it could be hard to explain to some
users why we allow one but not the other.  I'm not arguing that we should
allow this though, I'm just pointing out the other side of the argument.

Jim



More information about the Gcc-patches mailing list