Un-alignment in structures

Alan T. Bowler [SDG] atbowler at watmath.UUCP
Mon Mar 25 12:45:24 AEST 1985


In article <248 at rtech.ARPA> jeff at rtech.ARPA (Jeff Lichtman) writes:
>  I agree that the compiler shouldn't pad for you,
>because this takes away the choice.

Actually I really want the compiler to pad for me, the optimal
alignment varies from machine to machine, and I expect the compiler
to handle this detail for me by chosing the alignment that suits the
machine.  Doubles on some machines need 8 byte alignment, on others 2 byte.
The only way to be sure that a program will port with reasonable
effieciency is to assume that the compiler will know such things
and chose the correct alignments.  If the compiler is to be forbidden
the freedom to chose the natural alignments that will dramatically
increased the amount of work I have to do to port a program.



More information about the Comp.lang.c mailing list