Anonymous unions in C with gcc? 
Author Message
 Anonymous unions in C with gcc?

I ran into a need for anonymous unions in C today (don't ask),
and determined that Microsoft C and Watcom C allow that C++ism
in C, but Codewarrior and gcc don't.  (By the way,
Microsoft API's seem to rely on them, according to a recent post.)

Not that it's life or death, but *is* there a way
to get gcc to allow anonymous unions in a C program?
- Dan

--
Reply to dank at alumni.caltech.edu

The opinions expressed in this message are my own,
and are not the opinions of my employer.

Charles Darwin - a guy with a Vastly dangerous idea!



Thu, 22 Jul 1999 03:00:00 GMT  
 Anonymous unions in C with gcc?

Quote:

>I ran into a need for anonymous unions in C today (don't ask),

Is it true that this works only on promiscuous mode Ethernet adapters? :)


Sat, 24 Jul 1999 03:00:00 GMT  
 Anonymous unions in C with gcc?



Quote:
>I ran into a need for anonymous unions in C today (don't ask),
>and determined that Microsoft C and Watcom C allow that C++ism
>in C, but Codewarrior and gcc don't.  (By the way,
>Microsoft API's seem to rely on them, according to a recent post.)

>Not that it's life or death, but *is* there a way
>to get gcc to allow anonymous unions in a C program?

You can't have anonymous unions in a C program, because they are not
part of the C language.


Sat, 24 Jul 1999 03:00:00 GMT  
 Anonymous unions in C with gcc?

Quote:


> >Not that it's life or death, but *is* there a way
> >to get gcc to allow anonymous unions in a C program?

> Compile it as C++, but remember to declare all function interfaces
> as C.

Oh, right, that's a good idea!  Thanks.
- Dan

--
Reply to dank at alumni.caltech.edu

The opinions expressed in this message are my own,
and are not the opinions of my employer.

Charles Darwin - a guy with a Vastly dangerous idea!



Wed, 28 Jul 1999 03:00:00 GMT  
 Anonymous unions in C with gcc?


Quote:

>I ran into a need for anonymous unions in C today (don't ask),
>and determined that Microsoft C and Watcom C allow that C++ism
>in C, but Codewarrior and gcc don't.  (By the way,
>Microsoft API's seem to rely on them, according to a recent post.)

>Not that it's life or death, but *is* there a way
>to get gcc to allow anonymous unions in a C program?

Compile it as C++, but remember to declare all function interfaces
as C.

  Kjeld



Thu, 29 Jul 1999 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Anonymous unions in gcc

2. Anonymous union in VC++ 7

3. about "anonymous union" problem

4. anonymous structs and unions : legal?

5. Anonymous unions

6. Help: BC5 anonymous structures, unions

7. Anonymous sub-structures and GCC

8. union in VC and GCC

9. Newbie: separate big .cs file into small .cs files

10. Power of Unions ( surely union in C )

11. gcc g++: File.h for gcc - did you ever seen

12. Anonymous object ??

 

 
Powered by phpBB® Forum Software