Un-alignment in structures

Jon Mauney mauney at ncsu.UUCP
Thu Mar 21 02:22:02 AEST 1985


When asking for unaligned structures in C, don't forget to ask that
they be unaligned at the BIT level, because you might want to read
tapes containing 36 or 60 bit words.  Also make sure that the compiler
supports viewing numbers as having their bytes interchanged, because you
might want to go from the VAX to something sane, occasionally.  And we
want the compiler to convert between ones- and twos-complement, and among
the various representations of floating point, both binary and BCD.
Why should I have to write a different conversion routine for every
pair of machines, when they could all be added to the compiler for me?

Of course, the stodgy old standards commitee will never get sufficiently
enlightened to add these features to the language.  So we'll have to go
with the next-best thing: a library of good, generic data-conversion routines.
Fortunately, C provides lots of support for writing generic procedures.
-- 

_Doctor_                           Jon Mauney,    mcnc!ncsu!mauney
\__Mu__/                           North Carolina State University


[ Huh?  Put in a :-)?  What does that mean?]



More information about the Comp.lang.c mailing list