On Mon, 15 Nov 2010 13:46:45 -0500
Jim Jagielski <j...@jagunet.com> wrote:

> For the record, this is another reason why I don't like
> "optimizing" struct layouts and using bitfields, since you
> can no longer simply add additional elements to the end and
> allow for *some* compatibility... :/
> 
Well, you *could*.  You'd just (probably) sacrifice the optimisation.
Much the same story as a bunch of chars.

FWIW, if I'd been designing the above from scratch, those flags
would be a bitfield and a set of #defines, thus occupying a
fixed/known width in the struct.  Compared to that, using :1
just enables the compiler to optimise to an indeterminate size
according to its alignment rules.

-- 
Nick Kew

Reply via email to