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: 109fba,4873305131bf4d94 X-Google-Attributes: gid109fba,public X-Google-Thread: 1014db,4873305131bf4d94 X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,4873305131bf4d94 X-Google-Attributes: gid103376,public From: mkeesan@kenan.com (Morris M. Keesan) Subject: Re: How big is an int? (was: Yet another stupid language war (was: ... the only languages you need!!)) Date: 1997/11/06 Message-ID: <3461ee56.265363281@news>#1/1 X-Deja-AN: 287442827 References: <34557f2b.1934172@news.mindspring.com> <63oadj$ljc$1@helios.crest.nt.com> <63qkp9$bqr$3@darla.visi.com> <63r2sv$rgm$1@helios.crest.nt.com> Organization: Kenan Systems Corporation Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.lang.java.advocacy,comp.lang.c,comp.lang.c++ Date: 1997-11-06T00:00:00+00:00 List-Id: On 5 Nov 1997 16:27:11 -0800, kaz@helios.crest.nt.com (Kaz Kylheku) wrote: >In article <63qkp9$bqr$3@darla.visi.com>, >Peter Seebach wrote: ... >>No. Short is not required to be any smaller than long, nor any larger >>than char. A system where all four types are 64-bits is conforming. > >But it cannot be a conforming hosted implementation, as I pointed out >in the other article, because the getc() and putc() functions require >the int type to represent everything in the range of 0 to UCHAR_MAX, >plus the extra value EOF. It therefore follows that a hosted implementation >requires the additional requirement: > > char < int Here's where the problem of using this poorly-defined '<' notation comes in. If the < is interpreted to mean "has a smaller range of values than", then the above is correct. But I maintain that a conforming hosted implementation can exist where sizeof(char) == sizeof(int), as long as UCHAR_MAX < UINT_MAX. E.g., I believe the following would be conforming: #define EOF (-1) #define CHAR_BITS 64 #define UCHAR_MAX 0x7fffffffffffffff #define SCHAR_MAX UCHAR_MAX #define UINT_MAX 0xffffffffffffffff where sizeof(int) == sizeof(char) sizeof(long) == sizeof(int) -- Morris M. Keesan -- mkeesan@kenan.com Kenan Systems Corporation