On Sun, 11 Sep 2022, Paul Winalski wrote:
On 9/11/22, Bakul Shah <bakul(a)iitbombay.org>
wrote:
C's INT_MAX, LONG_MAX etc are kind of an environment enquiry...
What size to use in C for int and long (pointers had to be 64-bit; no
issue there) was a big headache for DEC in the migration of Unix
(Ultrix) from VAX to Alpha. The first C compiler implementation used
ILP64 (64 bits for int, long, and pointer) and ran afoul of a lot of
code that assumed an int was 32 bits. ILP64 vs. LP64 because as
divisive an issue as the big-endian vs. little-endian debate.
-Paul W.
When I first wrote C code I *assumed* things that were only necessarily
true on the platform I learned on (char=8, short=16, long=32; int=16,
pointer could be either 16 or 32, requiring the addition of the keywords
"near" and "far").
(I'm glad C99 introduced <stdint.h>, but on that platform the only C99
compiler is OpenWatcom.)
-uso.