This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: typeof and bitfields
- From: Paul Schlie <schlie at comcast dot net>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: <gcc at gcc dot gnu dot org>,Gabriel Dos Reis <gdr at integrable-solutions dot net>,Mark Mitchell <mark at codesourcery dot com>,Alexandre Oliva <aoliva at redhat dot com>,Dave Korn <dave dot korn at artimi dot com>,'Ian Lance Taylor' <ian at airs dot com>,'Neil Booth' <neil at daikokuya dot co dot uk>,'Matt Austern' <austern at apple dot com>,'Andrew Pinski' <pinskia at physics dot uc dot edu>
- Date: Tue, 18 Jan 2005 13:05:42 -0500
- Subject: Re: typeof and bitfields
> From: Andreas Schwab <schwab@suse.de>
>> Paul Schlie <schlie@comcast.net> writes:
>> Understand that it's not formally supported in C's syntax specification, but
>> curiously nor is the definition of struct { :3; }, although the text seems
>> to implies it defines a struct containing an 3-bit unnamed (and unspecified)
>> integer type?
>
> There is nothing in the semantics section that allows such a syntax.
???
6.5.2 Type specifiers
6.5.2.1 Structure and union specifiers
...
Semantics
...
[#10] A bit-field declaration with no declarator, but only a
colon and a width, indicates an unnamed bit-field.92 As a
special case of this, a bit-field structure member with a
width of 0 indicates that no further bit-field is to be
packed into the unit in which the previous bit-field, if
any, was placed.
(or do you mean there's nothing implying it's acceptable to be typedef'ed?
as was just noting that since a nameless bit-field may be declared in such
a way, then it would seem to follow that it may be typedef'ed analogously?)