Optimal structure field ordering

Doug Gwyn gwyn at brl-smoke.ARPA
Fri Jul 1 02:46:27 AEST 1988


In article <254 at obie.UUCP> wes at obie.UUCP (Barnacle Wes) writes:
>It would be very difficult to write a file system portable
>across machines of varying architecture (i.e. Idris) if the compiler
>on each machine can arbitrarily re-arrange structures to suit its own
>whim.

Although the original poster was mistaken about the order in which
struct members are assigned addresses, it is nonetheless impossible to
achieve binary file transportability simply by (acceptable) constraints
on C struct format.  There is a LOT more to binary data transportability
than byte padding, alignment, and sequencing.



More information about the Comp.lang.c mailing list