This is the mail archive of the gcc@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]

Re: Unnamed UNION and STRUCT members


"Pavel Pisa;research student" wrote:

[unnamed union in struct example]

> It seems to be M$ extension to C to allow unnamed members
> in structs and unions and members of these unnamed members
> can be accessed by its name in name space of containing structure
> or union.

It is an M$ extension, but AFAIK it's also defined in C9X, so egcs
should definitely know about it.

> It is interesting, that "C" frontend of EGCS generates
> errors for both (unions and structs) but "C++" can compile
> above example without problems, but reverse of union and
> struct ends with error.

Standard C++ allows unnamed unions in structs, so that's expected.

--
Branko Cibej   <branko.cibej@hermes.si>
HERMES SoftLab, Litijska 51, 1000 Ljubljana, Slovenia
phone: (++386 61) 186 53 49  fax: (++386 61) 186 52 70




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