Keith said:Malcolm McLean said:int should be the natural register size, which means 64 bits on a 64 bitsizeof sint_t 8
sizeof uint_t 8
The above set is for the 64-bit target which is why [su]int_t have size 8.
(I believe gcc defaults to 4 byte ints on 64-bit targets.)
system. That also means that, expect for the annoying but practically
unimportant case of a byte array that takes up over half the memory,
int can index any array.
Perhaps it "should". Nevertheless, int is typically 32 bits on 64-bit
systems, probably because making it 64 bits would mean you can't have
both a 16-bit type and a 32-bit type (unless the implementation resorts
to extended integer types).
More likely a mixture of too much fragile code that assumes 32 bit int
and more importantly for new code, performance.