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: 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: Dan.Pop@cern.ch (Dan Pop) 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: #1/1 X-Deja-AN: 288074613 Sender: news@news.cern.ch (USENET News System) X-Nntp-Posting-Host: ues5.cern.ch 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> <345f9c32.752004296@mrnews.mro.dec.com> Organization: CERN European Lab for Particle Physics Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.lang.java.advocacy,comp.lang.c,comp.lang.c++ Date: 1997-11-05T00:00:00+00:00 List-Id: In <345f9c32.752004296@mrnews.mro.dec.com> Peter.Mayne@digital.com (Peter Mayne) writes: >I'd say both of these statements are wrong. It depends on the >compiler. But the compiler itself is influenced by the CPU and the OS. Proof: Digital UNIX, OpenVMS and NT/Alpha use essentially the same compiler. Yet the size of a long depends on which operating system the compiler is running under (64 bits for 64-bit OSes and 32 bits for 32-bit OSes). This is a clear case of the OS influencing the implementation: there is no other reason for not a having a *standard* type which is 64-bit on a compiler for a 64-bit CPU. >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, They don't determine what the languages does, they do determine what the compiler does. If efficiency matters, the CPU will influence the size, if the interaction with other parts of the system matters, the OS will influence the size. How many implementations using 33-bit integers have you seen? >beyond the K&R suggestion of "typically reflecting the natural >size of integers on the host machine"? There's similar wording in the standard itself: A ``plain'' int object has the natural size suggested by the architecture of the execution environment... But I agree that this really doesn't impose any requirement on the implementation. The architecture may suggest different "natural" sizes to different implementors. >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? Is it "natural" to have no *standard* 64-bit integral type on a compiler for a CPU with 64-bit registers? Yet, this is the case for Alpha NT and OpenVMS compilers :-) Dan -- Dan Pop CERN, IT Division Email: Dan.Pop@cern.ch Mail: CERN - PPE, Bat. 31 1-014, CH-1211 Geneve 23, Switzerland