This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Unnamed UNION and STRUCT members
- To: "Pavel Pisa;research student" <pisa at waltz dot felk dot cvut dot cz>
- Subject: Re: Unnamed UNION and STRUCT members
- From: Branko Cibej <branko dot cibej at hermes dot si>
- Date: Wed, 18 Nov 1998 08:19:56 +0100
- Cc: egcs at cygnus dot com
- Organization: HERMES SoftLab
- References: <Pine.LNX.3.96.981117183921.32325A-100000@fu.felk.cvut.cz>
"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