S
Svein E. Seldal
Hello,
I have this:
struct mystruct {
int a;
union {
int b;
int c;
};
};
When I initialize it:
struct mystruct implement = {
.a = 1,
.b = 2
};
I get the following error from gcc:
error: unknown field `b' specified in initializer
Is it possible to do this kind of initialization alltogether with gcc?
How can I initialize the anonymous union in the struct listed above?
I know this is a gcc feature, but I wondered if there anyone here that
might know this, please.
Thanks,
Svein
I have this:
struct mystruct {
int a;
union {
int b;
int c;
};
};
When I initialize it:
struct mystruct implement = {
.a = 1,
.b = 2
};
I get the following error from gcc:
error: unknown field `b' specified in initializer
Is it possible to do this kind of initialization alltogether with gcc?
How can I initialize the anonymous union in the struct listed above?
I know this is a gcc feature, but I wondered if there anyone here that
might know this, please.
Thanks,
Svein