This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
problem with nameless structs and unions
- To: gcc-help at gcc dot gnu dot org
- Subject: problem with nameless structs and unions
- From: Tuukka Lehtonen <tvlehton at cc dot hut dot fi>
- Date: Fri, 16 Mar 2001 15:49:06 +0200 (EET)
Hi,
I'm already sorry, if this is the wrong place to send this question but
anyway, here I go:
take this simple structure for example
struct vec {
union {
int v[3];
struct {
int x,y,z;
};
};
};
GCC doesn't seem to support nameless structures inside unions for
example..
It just reports this when compiling the above code:
...anonymous class type not used to declare any objects
This would be very useful in many situations.
Is there any way to go round this flaw, to achieve the same functionality
as the above structure should provide, that is accessing the same elements
eith either indexing them or using plain vector component names?
-Tuukka Lehtonen