Alignment problems in C

bruce at su-shasta.arpa bruce at su-shasta.arpa
Wed Jan 2 17:01:45 AEST 1985


Having ``packed'' structures in C would help tremendously in writing
protocol code.  There really are times that the data is defined by
someone else, and having a clear (structured) way of describing it
is MUCH better than packing and unpacking inside of the receiving/
generating code.  It may also be more efficient.

I recommend some mechanism for forcing ``packed'' structures.  If
a particular compiler cannot handle some alignments, it can complain
when it sees them, e.g., { char, short, long } can complain about the
short and/or long on an odd boundary.

This would be a useful ``standard extension'' to C.

/Bruce Borden



More information about the Comp.lang.c mailing list