> Hi there,
>
> Is there a single blessed way to define packed structures
> for use in drivers? I suspect that using "#pragma pack(1)"
> will lead to alignment errors in non-Intel architectures.
Any form of packing is going to cause problems for items that are
located in illegal fashions.
Having said that, I recommend using __attribute__ ((packed))
to explicitly request that a structure be packed.
> Should char arrays be used for all multi-byte elements to
> avoid alignment problems?
No.
> And is it OK to rely on specially crafted structures, like
> "struct fs" in /sys/ufs/ffs/fs.h where multi-byte elements
> are pre-aligned by the structure's design, being contiguous?
"rely" in what fashion?
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message