This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Unnamed unions


> 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;
> }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]