__attribute__((packed)) is not part of the standard, and therefore doesn't quite answer the question. I believe the standards-compliant way of doing this is that "you can't".
Since you don't actually access the size of the structure, I see no reason why it matters. Also, FWIW, your code has undefined behavior because you call printf with the wrong type.
saagarjha|6 years ago
klingonopera|6 years ago
saagarjha|6 years ago
Gibbon1|6 years ago
This isn't true of modern processors.
jzwinck|6 years ago