This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
initialising anonymous unions
- From: David Howells <dhowells at redhat dot com>
- To: Richard Sandiford <rsandifo at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 17 Oct 2003 11:26:17 +0100
- Subject: initialising anonymous unions
Should the following compile?
struct wibble {
int a;
int b;
int c;
union {
int x;
void *y;
};
};
struct wibble fred = {
.a = 1,
.b = 2,
.c = 3,
.x = 1234,
};
Or is there some other way to refer to x or y?
What I see is:
dhowells>gcc -s union.c
union.c:15: unknown field `x' specified in initializer
David