This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Does gcc accept unions?
- From: Andrea 'Fyre Wyzard' Bocci <fwyzard at inwind dot it>
- To: Hihn Jason <JasonHihn at DANFOSS dot com>,"'gcc-help at gcc dot gnu dot org'" <gcc-help at gcc dot gnu dot org>
- Date: Wed, 20 Feb 2002 21:06:16 +0100
- Subject: Re: Does gcc accept unions?
At 19.18 20/02/2002 (GMT +0100), Hihn Jason wrote:
>I have the following simple union:
>
>typedef union
>{
> int i; // integer
> char *str; // string
> void *p; // pointer to whatever
> float *pf; // pointer to a float
> int *pi; // pointer to an integer
>} ARG;
>
>which looks legal to me (and other compilers compile it)
>but I get on the "} ARG;" line:
>parse error before `}'
>warning: data definition has no type or storage class
I've tried your code, compiling with gcc and g++, with either 2.96 or 3.0.2.
Even using -W -Wall, I get no warning at all.
Maybe the problem is in some statement coming BEFORE your declaration ?
fwyzard