unnamed fields of type other than struct or union are not allowed

Luben Tuikov luben@splentec.com
Sat Oct 26 15:05:00 GMT 2002


Luben Tuikov wrote:
> I have a similar construct:
> 
> struct test {
>     unsigned char :1;
> 
>     int            i;
>     int            ;
>     long           l;
> };
> 
> and the compiler complains:
> 
> somefile.c:line#: unnamed fields of type other than struct or union are 
> not allowed
> 
> This used to work with gcc 3.0.4 and before.
> 
> Can someone tell me why the bitfield is ok to be unnamed but
> the int cannot be unnamed?
> 
> Thanks,

Forgot to mention: I'm using gcc-3.2.

-- 
Luben




More information about the Gcc-help mailing list