tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Improving the data supplied by BPF



On Fri, Dec 26, 2008 at 07:45:53PM +0100, Joerg Sonnenberger wrote:
> On Fri, Dec 26, 2008 at 12:39:42PM -0600, David Young wrote:
> > I don't think that you can force space-optimal packing by re-ordering
> > members, can you?  AFAIK, no standard forbids the compiler from
> > padding this struct,
> 
> The standard doesn't, but any sane ABI will. I don't think we should
> really bother with theoritical compilers or the mistakes of the ancient
> past. The only mildly insane ABI left is ARM with the explicit struct
> alignment rules.

One should still write code that is portable by writing that the
struct is __packed __aligned(n), if only to persuade those of us
who try to rely on only one arcane standard at a time to interpret
a program. :-)

Dave

-- 
David Young             OJC Technologies
dyoung%ojctech.com@localhost      Urbana, IL * (217) 278-3933


Home | Main Index | Thread Index | Old Index