This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR c/6660


>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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]