From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,INVALID_MSGID, PLING_QUERY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4873305131bf4d94 X-Google-Attributes: gid103376,public X-Google-Thread: fdb77,4873305131bf4d94 X-Google-Attributes: gidfdb77,public X-Google-Thread: 109fba,4873305131bf4d94 X-Google-Attributes: gid109fba,public X-Google-Thread: 1014db,4873305131bf4d94 X-Google-Attributes: gid1014db,public From: ulric@evelin.edu.stockholm.se (Ulric Eriksson) Subject: Re: How big is an int? (was: Yet another stupid language war (was: ... the only languages you need!!)) Date: 1997/11/05 Message-ID: <63qu1h$8pe$1@home.edu.stockholm.se>#1/1 X-Deja-AN: 287357901 References: <34557f2b.1934172@news.mindspring.com> <34666a87.96408197@pncnt.tecnomen.ie> <345f9c32.752004296@mrnews.mro.dec.com> <346a4ce9.154362161@pncnt.tecnomen.ie> Organization: Chez Ulric Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.lang.java.advocacy Date: 1997-11-05T00:00:00+00:00 List-Id: In article <346a4ce9.154362161@pncnt.tecnomen.ie>, Mark Burkley wrote: >Peter.Mayne@digital.com (Peter Mayne) wrote: > >[snip] > >>>>Actually, the size of the variables (the byte sizes) depend on the operating >>>>system. >>> >>>More usually, it depends on the CPU. >> >>I'd say both of these statements are wrong. It depends on the >>compiler. I've used languages with 64 bit integers on 8 bit systems: >>why should the operating system or the CPU determine what the language >>does, beyond the K&R suggestion of "typically reflecting the natural >>size of integers on the host machine"? > >IMHO, the *natural* size implies the default register size. I'm not >familiar with Alpha processors so I can't comment on them. It depends on the OS, the CPU, the compiler *and* the register size. I have in my home computers with 8-bit, 16-bit and 32-bit CPU's. On all of those systems, 16 bits is the most natural integer size. 8 bits is clearly to little to store an int, so that's out of the question. 16 bits is natural on a 16-bitter, naturally. ;-) The reason for using 16 bits on the CPU with 32 bit registers is that the OS on that computer tries to mimic MS-DOS. Ulric -- Should we or should we not follow the advice of the galactically stupid? "Ya gonna neuter him too?"