Mail Archives: djgpp/1995/11/01/05:16:21
Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> writes:
> Gcc (and other 32-bit compilers) pad structures so that they could be
> accessed faster by 32-bit processors (there is a penalty of accessing
> unaligned addresses). It is usually wrong to assume that sizeof of a
> struct is the sum of the sizes of its fields; . . .
In fact, the ANSI C standard indicates that there can be padding, so
assuming that thtere is no padding is not only not generally right,
but also violates the ANSI standard.
Erik Max Francis, &tSftDotIotE || uuwest!alcyone!max, max AT alcyone DOT darkside DOT com
San Jose, California, U.S.A. || 37 20 07 N 121 53 38 W || the 4th R is respect
H.3`S,3,P,3$S,#$Q,C`Q,3,P,3$S,#$Q,3`Q,3,P,C$Q,#(Q.#`-"C`- || 1love || folasade
_Omnia quia sunt, lumina sunt._ || GIGO Omega Psi || http://www.spies.com/max/
"Hands that once picked cotton can now pick Presidents." -- Jesse Jackson
- Raw text -