This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Does gcc accept unions?
- From: Hihn Jason <JasonHihn at DANFOSS dot com>
- To: "'gcc-help at gcc dot gnu dot org'" <gcc-help at gcc dot gnu dot org>
- Date: Wed, 20 Feb 2002 19:18:57 +0100
- Subject: Does gcc accept unions?
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 -traditional and -ansi, along with combinations of union ARG
{..};
Can anyone help me sort this out?
Thanks,
Jason