svn commit: r195460 - projects/mesh11s/sys/net80211
Dag-Erling Smørgrav
des at des.no
Thu Jul 9 15:41:30 UTC 2009
Bruce Evans <brde at optusnet.com.au> writes:
> Broken ABIs (e.g., arm?) may add padding at the end of structs,
Padding at the end of a struct is *required* to ensure proper alignment
of the next element in an array, e.g.
struct foo { int i; char c; } bar[2];
Assuming a four-byte alignment requirement for int, the compiler *must*
add three bytes of padding at the end of struct foo so bar[1].i is
correctly aligned.
cf. ISO/IEC 9899:1999 §6.7.2.1:
15 There may be unnamed padding at the end of a structure or union.
DES
--
Dag-Erling Smørgrav - des at des.no
More information about the svn-src-projects
mailing list