It appears that Phil Budne <phil(a)ultimate.com> said:
Noel Chiappa wrote:
From:
Larry McVoy
Not once did I think about packing, the structs
somehow just worked on
the machines I was working on. Maybe the TCP/IP guys knew about spacing
in the structs.
Not really! Of the first 6 TCP/IP implementations:
only 1 was in C - and it was a relatively late one. The earliest ones were
mostly in assembler (PDP-10 and PDP-11).
BUT, the basic TCP and IP protocols seem to have been created with a
general care that two byte fields should be aligned at multiples of
two bytes and four byte fields should be at multiples of four bytes,
or at the VERY least, no multi-byte field should cross a four byte
boundary (which would have been a pain to PDP-10 programmers who
likely expected 32 bits of data in each 36 bit word).
There were a bunch of S/360 systems, which also need two- and
four-byte fiekds to be aligned unless you do extra byte string moves
to pack and unpack the structures.
And as for C: It was born on a 16-bit word system that
expected 16-bit
aligned words, replacing B, a language with just the word datatype, on
a system with a 32KB (or less) user space, by people who had just come
from a project where waiting for working production PL/I compiler had
been a major headache, and generally suffered from "second system
syndrome" bloat.
I believe the earliest versions of C were on a GE 635, a word addressed
machine comparable to a PDP-10. But it moved to a PDP-11 soon enough
where the byte and word addresses motivated the datatypes that turned
B into C.
R's,
John