• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Alignment in structs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Alignment in structs


  • Subject: Re: Alignment in structs
  • From: "Sean McBride" <email@hidden>
  • Date: Mon, 17 Jul 2006 11:16:52 -0400
  • Organization: Rogue Research

On 2006-07-14 19:41, Laurence Harris said:

>> #pragma pack(2)
>>
>> typedef struct Blah {
>> 	UInt32		a, b, c;
>> 	SInt16		d;
>> } Blah;
>>
>> #pragma pack()
>>
>> Hope this helps,
>
>Thanks. Now, would I see padding issues with this as well:
>
>typedef struct Blah {
>	SInt16		d;
>	UInt32		a, b, c;
>} Blah;

BTW, you can use the -Wpadded warning to have gcc tell you when it pads
structs.  Annoying to have on all the time, but useful if you're
switching compilers I guess.

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


 _______________________________________________
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

References: 
 >Alignment in structs (From: Laurence Harris <email@hidden>)
 >Re: Alignment in structs (From: Eric Albert <email@hidden>)
 >Re: Alignment in structs (From: Laurence Harris <email@hidden>)

  • Prev by Date: Re: [ANN] Xcode + Leopard at WWDC this year
  • Next by Date: Re: Interface Builder Text Validation
  • Previous by thread: Re: Alignment in structs
  • Next by thread: Re: Alignment in structs
  • Index(es):
    • Date
    • Thread