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



> 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 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.

That's because anonymous unions are a standard C++ feature but are
not present in C.  Unfortunately several vendors with common C/C++
front ends backported some C++ features to C without alerting users
to this fact.  (gcc surrendered on // comments, kind of wish it hadn't).


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