Sujet : Re: VMS
De : bowman (at) *nospam* montana.com (rbowman)
Groupes : comp.os.linux.miscDate : 01. Jul 2025, 05:02:55
Autres entêtes
Message-ID : <mch4veFs6a9U2@mid.individual.net>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
User-Agent : Pan/0.160 (Toresk; )
On Mon, 30 Jun 2025 23:12:21 -0400, c186282 wrote:
MOST compilers, I think ints are still almost always 16-bits as a
holdover from the good old days. You can declare long and long long
ints of course, but int alone, expect it to be 16-bit.
Not any compiler I've worked with in the last few decades. That sort of
went out with CP/M. Way back when bytes were worth their weight in gold
someone declared 'short ObjNum;' That's rather important since that is
the number of objects that can be handled by the system including
incidents, comments, persons, vehicles, alerts and so forth. Being signed
and 16 bits the maximum value is 32767
It got by for an amazingly long time but as larger, busier sites came
along the system ran out of object number. It wasn't pretty.
Edit a number of files to make it an unsigned short and you get 65535. It
was close a couple of times but with some sophisticated reuse strategies
there never was a disaster.
Why not make it an int? Even with a signed int 2147483647 wouldn't be a
problem. Because an int is 32 bits. Every struct, every XDR encoding,
database, and so forth would have to be modified so we crossed our
fingers. In DB2 SMALLINT is 16 bits, INT is 32 bits. SQL Server is the
same. Both of them use BIGINT for 64 bits.