Unnamed unions

Doug Landauer landauer@apple.com
Fri Feb 16 15:59:00 GMT 2001


> I end up porting a lot of code that is built with VC++ and/or 
> Metrowerks to Mac OS X using gcc.  Apparently both of these compilers 
> support the following:

My tests show gcc supporting anonymous unions as well.
Are you maybe thinking of anonymous structs?


> struct {
>   union {
> 	int a, b;
>  };
> } x;
>
> int main()
> {
>     x.a = 1;
>     return 0;
> }



More information about the Gcc mailing list