type and size of bit-fields

Doug Gwyn gwyn at smoke.brl.mil
Thu Mar 21 14:40:02 AEST 1991


In article <1991Mar20.224317.1265 at grebyn.com> ckp at grebyn.com (Checkpoint Technologies) writes:
>...  This would seem to prohibit writing records with bit fields to
>external storage, if there's any chance that the program in question
>will ever be recompiled and then asked to deal with the same records.

Yes, indeed, if any program other than THE SAME PROCESS THAT WROTE IT
reads a binary "dump" of C data structures, there is no guarantee that
it will have the appropriate format.

>Perhaps the Standard has something to say in this regard?

It does NOT require all implementations to make the same choice for
bit field ordering, structure member padding, etc.  Successive
releases of the "same" compiler are considered different implementations.



More information about the Comp.lang.c mailing list