alignment of struxures

Bob Larson BLARSON%ECLD at usc-ecl.ARPA
Fri Jan 4 18:04:46 AEST 1985


Not at all portable.  Many machines KNOW (and need to know) that all
pointers to long (for example) are always aligned on a long word boundary.
Since the same machines force alignment of structures, structure assignment
won't work either.  The only type of copy that will work is the appropriate
number of char assignments.  (Of course a loop, macro, or function can be
used.) (To bad C doesn't have array assignments.)  (This assumes that
everything is an integral number of bytes... True on most machines.  (I
think pcc for tops-20 uses 36 bit characters... yuck.))

Bob Larson <Blarson at Usc-Ecl.Arpa>
-------



More information about the Comp.lang.c mailing list