Subject: Re: structure alignment on arm in NetBSD? (resend without html)
To: Martin Fouts <mfouts@danger.com>
From: Jason Thorpe <thorpej@shagadelic.org>
List: tech-toolchain
Date: 10/16/2007 15:58:40
On Oct 16, 2007, at 10:50 AM, Martin Fouts wrote:

>> A common solution to this problem is use the packed attribute to
> indicate such structures and to allow the compiler to align to natural
> boundaries otherwise.

Using __packed__ has other side-effects, and often it's not so nice  
(e.g. the compiler almost always generates awful code when accessing  
members of packed structures).  Just because you don't want to pad the  
structure doesn't mean you aren't going to assume natural alignment of  
the members of that structure, but GCC doesn't distinguish between  
those.

> It tends to aid in ABI compatibility, improves performance where the
> packing would lead to poor code generation when not needed, and helps
> document those structures which aren't necessarily machine  
> independent.


IIRC, NetBSD's behavior in this regard is actually compatible with  
ATPCS, is it not?

-- thorpej