Representation Clauses

Karl Keyte KKEYTE at ESOC.BITNET
Thu Feb 14 00:14:19 AEST 1991


How flexible are ANSI?  I.e. is 'C's standardisation fixed?
I feel that 'C' is missing data alignment representation clauses in
structures.  I would like to be able to do something like:

  struct ALIGN_TEST
  {
     int       a      at 0;
     char      b      at 4;
     float     c      at 8;

  }

in order to force the offset of the elements.  This then enables
structures to provide truly portable messages on machines with
different structure alignments.  For example, the above structure
is not the same on a Sun-3 and a Sun-4 (Sparc).

???



More information about the Comp.std.c mailing list