RE: alignment errors on armel: what to do?
> From: Daniel Kahn Gillmor [mailto:email@example.com]
> Sent: Tuesday, September 29, 2009 5:09 PM
> To: firstname.lastname@example.org
> Subject: Re: alignment errors on armel: what to do?
> true, i'm not saying it's non-compliant that it's char-aligned. it's
> just interesting to observe that in i386, it seems to be guaranteed to
> be word-aligned, even if i do:
> char g;
> char f;
> both &g and f are 32-bit aligned on i386. not so when i build on armel.
> given armel's failures on alignment errors (and i386's apparent ability
> to handle them gracefully -- try passing f+1 to test() ) i find it
> curious that gcc would be *more* cautious about over-alignment on i386
> than on armel.
For armel, this is the expected behavior according to eabi, which uses "natural" alignment. Gcc for i386, I guess, uses the default alignment of 4 bytes. The compilers do not seem to be wrong.