One of the things that continues to baffle me (and my colleagues) is
the bizarre way in which attributes such as "packed" work when applied
to structs.

It would be natural to assume, as Shaun did, that marking a struct
"packed" (or, for that matter, "packed,aligned(2)") would apply that
attribute to the fields of the struct.

But it doesn't work that way.  To get the right results, you have to
stick attributes all over the structure fields, one by one.  This is
highly counterintuive.

Worse yet, in this example the attribute is applied to the structure
elements to some extent but not consistently -- it causes the fields
to be packed -- hence unaligned -- but it does not do unaligned
accesses to the fields.

This sure looks like a bug.

     paul

Reply via email to