This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: for the future: Plan 9's anonymous structs
- To: mrs at wrs dot com (Mike Stump)
- Subject: Re: for the future: Plan 9's anonymous structs
- From: Andi Kleen <ak at muc dot de>
- Date: 13 Jan 1999 16:17:34 +0100
- cc: egcs at cygnus dot com
- References: <199901130238.SAA01783@kankakee.wrs.com>
In article <199901130238.SAA01783@kankakee.wrs.com>,
mrs@wrs.com (Mike Stump) writes:
>> Date: Tue, 12 Jan 1999 02:17:10 -0500
>> From: Zack Weinberg <zack@rabi.columbia.edu>
>> Plan 9's C compiler has an extension which is very useful: anonymous struct
>> members.
>> I suppose I can attempt to do this myself, but I know nothing about the C
>> front end, so where would I start and how hard would it be?
> Part of the benefit of GNU C, is that it has a nice predictible
> (usually) relationship with GNU C++. This is achived in part because
> features are added to both C and C++ at the same time. C++ I think
> may complicate the above extension, and one should examine C++ and
> it's required semantics before doing this for C so as to not diverge
> them more than necessary.
In C++ there is no extension, because anonymous unions are part of the C++
Standard and already work fine with g++
BTW, VC++ supports anonymous unions too, even in C mode. Apparently some
windows system includes use this extension.
-Andi