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=0.3 required=5.0 tests=BAYES_00,INVALID_MSGID, PLING_QUERY,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fdb77,4873305131bf4d94 X-Google-Attributes: gidfdb77,public X-Google-Thread: 103376,4873305131bf4d94 X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,4873305131bf4d94 X-Google-Attributes: gid1014db,public X-Google-Thread: 109fba,4873305131bf4d94 X-Google-Attributes: gid109fba,public From: Peter.Mayne@digital.com (Peter Mayne) Subject: Re: How big is an int? (was: Yet another stupid language war (was: ... the only languages you need!!)) Date: 1997/11/04 Message-ID: <345f9c32.752004296@mrnews.mro.dec.com>#1/1 X-Deja-AN: 287996360 References: <34557f2b.1934172@news.mindspring.com> <3456e71b.3833189@news.mindspring.com> <3458D116.2D34@pseserv3.fw.hac.com> <63anc7$75p$1@darla.visi.com> <345947D2.D20EF8E9@horvath.com> <345F49A2.5F5DC5A0@aom.ericsson.se> <345f4f9e.0@isc-newsserver.isc.rit.edu> <34666a87.96408197@pncnt.tecnomen.ie> Organization: Digital Equipment Corporation Reply-To: Peter.Mayne@digital.com Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.lang.java.advocacy,comp.lang.c,comp.lang.c++ Date: 1997-11-04T00:00:00+00:00 List-Id: On Tue, 04 Nov 1997 18:33:45 GMT, mark@$tecnomen$.ie (Mark Burkley) wrote: > int is *normally* the register size of the machine you >are using. If you are using a 64-bit platform, an int will probably >be 8 bytes. On an Alpha (a 64 bit platform) running DIGITAL UNIX using cc: short = 2 int = 4 long = 8 On an Alpha (a 64 bit platform) running Windows NT using VC++ 5 or OpenVMS using DECC: short = 2 int = 4 long = 4 >>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"? In the case of Alpha, it may have 64 bit registers, but it has natural 32 bit and 64 bit datatypes. Is one more "natural" than the other? PJDM Digital Equipment Corporation (Australia), Canberra, ACT ------------------------------------------------------------------------------- These are my opinions, and have nothing to do with Digital. This was edited by a wheelbarrow full of walruses.