Re: Alignment in structs
Re: Alignment in structs
- Subject: Re: Alignment in structs
- From: Laurence Harris <email@hidden>
- Date: Fri, 14 Jul 2006 21:05:57 -0400
On Jul 14, 2006, at 6:59 PM, Rush Manbert wrote:
Laurence Harris wrote:
What do I need to set in Xcode to get the size of this struct:
typedef struct Blah {
UInt32 a, b, c;
SInt16 d;
} Blah;
to be 14 instead of the 16 I'm getting currently? Thanks,
Try this:
typedef struct Blah {
UInt32 a, b, c;
SInt16 d;
} __attribute__((__packed__)) Blah;
When I try this, the following line:
err = Foo( x, data.a );
generates this warning:
: error: cannot bind packed field 'data.Blah::a' to 'UInt32&'
OSErr Foo ( FSVolumeRefNum inVRefNum, UInt32 &inID );
Larry
_______________________________________________
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