2 ms·
FWIW "short" has always been 16 bits. It was introduced with VAX Unix (and a few other 32 bit architectures) so that you could easily port code that assumed 16
by ajross 3y ago
FWIW "short" has always been 16 bits. It was introduced with VAX Unix (and a few other 32 bit architectures) so that you could easily port code that assumed 16 bit arithmetic.
The point isn't that, today, you'd choose to do what C did. But in 1977 there weren't a lot of other options. Early C did indeed have fixed, defined types. But moving to the VAX messed all that up. They had to choose to either add new types (and thus turn a bunch of code that would otherwise run fast on the VAX into weirdly-interpreted nonsense) or update the existing types so that idiomatic PDP-11 code still did what you expect most of the time. They chose the latter.