[head tinderbox] failure on arm/arm
Nicholas Clark
nick at ccl4.org
Sun Nov 12 08:59:17 PST 2006
On Sun, Nov 12, 2006 at 06:57:23PM +0300, Ruslan Ermilov wrote:
> So your sizeof() argument, well... I don't understand it and it
> doesn't make things clearer at least to me. I still believe this
> is bug in GCC that the alignment requirement is so high for a
> "struct foo { char x; }" (there's no real reason for this!).
It is no bug in GCC. ANSI C gives extreme flexibility for the compiler to
align (or pad) structures. The assumptions in the code you presented are not
portable. The problem tends to be that ARM is the only common platform that
does structure alignment this way, so tends to trip up a lot of code that
has worked just fine in many other places.
There is a lot more detail in
http://netwinder.osuosl.org/users/b/brianbr/public_html/alignment.html
including how gcc's __packed__ extention can be used to tell gcc to align
structures in different ways.
Nicholas Clark
More information about the freebsd-current
mailing list