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: 109fba,4873305131bf4d94 X-Google-Attributes: gid109fba,public X-Google-Thread: fdb77,4873305131bf4d94 X-Google-Attributes: gidfdb77,public X-Google-Thread: 1014db,4873305131bf4d94 X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,4873305131bf4d94 X-Google-Attributes: gid103376,public From: ohk@tfdt-o.nta.no (Ole-Hjalmar Kristensen FOU.TD/DELAB) Subject: Re: How big is an int? (was: Yet another stupid language war (was: ... the only languages you need!!)) Date: 1997/11/07 Message-ID: #1/1 X-Deja-AN: 287624347 References: <34557f2b.1934172@news.mindspring.com> <63anc7$75p$1@darla.visi.com> <345947D2.D20EF8E9@horvath.com> <345F49A2.5F5DC5A0@aom.ericsson.se> <63oadj$ljc$1@helios.crest.nt.com> Organization: Telenor Online Public Access Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.lang.java.advocacy,comp.lang.c,comp.lang.c++ Date: 1997-11-07T00:00:00+00:00 List-Id: nospam@spam.com writes: > kaz@helios.crest.nt.com (Kaz Kylheku) writes: > > > > > In article <345F49A2.5F5DC5A0@aom.ericsson.se>, > > Ted Lyngmo wrote: > > >Bob Horvath wrote: > > >> > > >> Hmmmm. How big is an int? > > > > > >As I've understood it, an int has two legal sizes. A short has only one, > > > > You haven't understood it. > > > > A short is large enough to represent numbers in the range -32767 to > > 32767. An int is also large enough to represent numbers in the > > same range. A long can represent numbers in the range -2147483647 > > to +2147483647. > > Nor have you. The definitions are as follows. > > short <= int <= long > short < long > short > char > Yes, but it is also explicitly stated that "The values below are acceptable minimum magnitudes; larger values may be used. ... INT_MAX +32767 INT_MIN -32767 LONG_MAX +2147483647L LONG_MIN -2147483647L ... SHRT_MAX +32767 SHRT_MIN -32767 " So what you say used to be true, but isn't any more. > If your system does not conform to this, it isn't ISO (I thinhk it was ISO) > compliant. > > What you stated above is true for (I would assume) all 32bit systems. It > will not necessarily hold for 64 bit or 128 bit systems. > It holds for all systems, else it's not standard C. > I even had one person in the past try and tell me that when Intel went to > 64bits, that M$ was going to have: > > short = 2 bytes > long = 4 bytes > int = 8 bytes > > > > /Mike