Optimal structure field ordering

Walter Murray walter at hpcllz2.HP.COM
Wed Jun 29 09:53:43 AEST 1988


Doug Gwyn writes:

>In article <164 at navtech.uucp> mark at navtech.UUCP (Mark Stevans) writes:
>>Some responder pointed out correctly that there is no guarantee in the C
>>language that the compiler will preserve your field ordering

>Oh, yes there is.
>----------

Or, to quote the proposed standard (January, 1988, draft):

   "Within a structure object, the non-bit-field members and the 
   units in which bit-fields reside have addresses that increase
   in the order in which they are declared."



More information about the Comp.lang.c mailing list