Re: anonymous structs in union
Re: anonymous structs in union
- Subject: Re: anonymous structs in union
- From: Peter Mulholland <email@hidden>
- Date: Wed, 6 Jun 2007 08:43:41 +0100
Hello Luigi,
Wednesday, June 6, 2007, 8:02:16 AM, you wrote:
> Hi there,
> I have an union declaration as follows:
> typedef union _vec3
> {
> struct {
> float x,y,z;
> };
> struct {
> float s,t,r;
> };
> float values[3];
> } t_vec3;
> When I use the following code:
> t_vec3 vector;
> vector.x = 1;
> vector.y = 2;
> vector.z = 3;
> X-code complains with this error:
> error: t_vec3' has no member named 'x'
> error: t_vec3' has no member named 'y'
> error: t_vec3' has no member named 'z'
> Does xcode have an option to support anonymous structs and unions ?
> Thank you.
> - Luigi
Try -fms-extensions in your C flags.
Also see here:
http://gcc.gnu.org/onlinedocs/gcc-4.0.4/gcc/Unnamed-Fields.html#Unnamed-Fields
--
Best regards,
Peter mailto:email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden