Paul Eggert said:
That got thrown out the window long ago, I'm afraid. On the Alpha,
for example, the "natural size suggested by the architecture" is 64
bits, but int is 32 bits. This is because they needed some type to be
32 bits, and at the time the Alpha was designed, 'int' was the only
plausible type available. Other 64-bit platforms have mostly followed
suit. Perhaps the Alpha team would have chosen differently had C99
been available back then.
In the absence of extended integer types, there's a strong pressure to
make int no more than 32 bits on most systems. Assuming an 8-bit byte,
this gives you:
char 8 bits
short 16 bits
int 32 bits
long 32 or 64 bits
long long 64 bits
If you make int 64 bits, then either you don't have a 16-bit type, or
you don't have a 32-bit type. This can cause serious problems for
some software (as I've found out while trying to compile large
software packages on Crays).
Of course a C99 implementation could fill the gaps with extended
integer types, but no C90-conforming software can use them. That's
not quite true given a C90 implementation of <stdint.h>, but the C90
solutions for this kind of thing are usually limited to the standard
types.
The fundamental problem, I think, is that C's integer type system
isn't uniform enough. The type names are all keywords or sequences of
keywords with a very limited grammar, and it's far too easy for unwary
programmers to create dependencies on certain types being certain
sizes.
One possible solution that's consistent with what's been done so far
might be to allow a "short short" type. Then you could have:
char 8 bits
short short 16 bits
short 32 bits
int 64 bits
long 64 bits
long long 128 bits?
(and maybe "long char" rather than "wchar_t").