Bill Studenmund (wrstuden@loki.stanford.edu) wrote:
: On port-i386, sizeof(struct llc) == 8, while on port-mac68k
: sizeof(struct llc) == 10 !!!!!
[...]
: The weird thing was that the code always generated a correct
: snap header, just adding two extra bytes onto the end.
:
: How can we fix this?
Basically, the compiler is free to add to structs whatever padding it
things will help, or hinder, performance. Code that depends on a certain
layout, other than to assume it will be the same for one execution of
the program, is in error.
All we can legally do is to access bytes from a byte array, by byte offset.
Regards,
Ignatios Souvatzis