Re: Miscellaneous XCode Questions
Re: Miscellaneous XCode Questions
- Subject: Re: Miscellaneous XCode Questions
- From: Greg Guerin <email@hidden>
- Date: Fri, 12 May 2006 17:39:38 -0700
Ben Weiss wrote:
>(envisioning the chaos that would ensue if compilers suddenly decided to
>enforce this...) If it's illegal C, why doesn't gcc generate an error (or
>at least a warning?)
It's legal C, from the source standpoint, but operand alignment
requirements of any recast pointers are entirely machine-dependent. This
has always been true of C code. I bet it's even written into the standard,
though I can't cite chapter and verse.
Going from a smaller or less-aligned type to a larger or aligned type
always requires that the author of the code know about and handle any
operand alignment restrictions. It's one of the funnest things to track
down and fix when porting code from an unaligned CPU (e.g. classical x86)
to any CPU with operand alignment restrictions (e.g. many non-x86).
-- GG
_______________________________________________
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