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: 1014db,4873305131bf4d94 X-Google-Attributes: gid1014db,public X-Google-Thread: 109fba,4873305131bf4d94 X-Google-Attributes: gid109fba,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/14 Message-ID: <346cab51.259469125@news>#1/1 X-Deja-AN: 290099823 References: <345F49A2.5F5DC5A0@aom.ericsson.se> <63oadj$ljc$1@helios.crest.nt.com> <63se05$bgu$1@news.nyu.edu> <873814018snz@genesis.demon.co.uk> Organization: Kenan Systems Corporation Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++ Date: 1997-11-14T00:00:00+00:00 List-Id: On Sun, 09 Nov 97 14:06:58 GMT, fred@genesis.demon.co.uk (Lawrence Kirby) wrote: >In article Dan.Pop@cern.ch "Dan Pop" writes: > >... > >>It is theoretically possible to have an implementation with >>sizeof(long) < sizeof(int) < sizeof(short), but even on that >>implementation you must have SHRT_MAX <= INT_MAX <= LONG_MAX (otherwise >>the integral promotion rules would stop working), so the types short and >>int would make a very inefficient use of their allocated space. > >More directly it violates 6.1.2.5: > >"There are four signed integer types, designated as signed char, short int, > int and long int > > ... > > ...In the list of signed integer types above, the range of values of each > type is a subrange of the values of the next type in the list" > If SHRT_MAX <= INT_MAX <= LONG_MAX and SHRT_MIN >= INT_MIN >= LONG_MIN, how does sizeof(long) < sizeof(int) < sizeof(short) violate 6.1.2.5? 6.1.2.5 directly addresses the VALUE RANGES of the types, not their sizes. -- Morris M. Keesan -- mkeesan@kenan.com Kenan Systems Corporation