Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!mit-eddie!genrad!decvax!tektronix!reed!nscpdc!joemu From: joemu@nscpdc.NSC.COM (Joe Mueller) Newsgroups: comp.lang.c Subject: Re: draft ANSI standard: one change that would *really* help Europe Message-ID: <790@nscpdc.NSC.COM> Date: Wed, 17-Dec-86 13:11:32 EST Article-I.D.: nscpdc.790 Posted: Wed Dec 17 13:11:32 1986 Date-Received: Thu, 18-Dec-86 21:15:46 EST References: <1382@hoptoad.uucp> <8322@lll-crg.ARpA> <1715@batcomputer.tn.cornell.edu> Organization: National Semiconductor, Portland Development Center, Portland, OR Lines: 27 Summary: what the standard says... In article <1715@batcomputer.tn.cornell.edu>, braner@batcomputer.tn.cornell.edu (braner) writes: > > I suggest that the standard require: > > 'short' to be at least 8 bits, > > 'int' to be at least 16 bits (but 32 bits NOT promised!), > > 'long' to be at least 32 bits and long enough to hold a pointer. > > These requirements, being MINIMUM sizes, would only guarantee that a > program which assumes them would work everywhere. But note: the > assumption that (unsigned shorts) 0200 + 0200 == 0 is NOT legal, > since it assumes the size is NO MORE than 8 bits! The standard already does this, on pp 173 of the Oct. 1 1986 draft: #define CHAR_BIT 8 #define INT_MAX 32767 #define INT_MIN -32767 #define LONG_MAX 2147483647 #define LONG_MIN -2147483647 This gives you the minimum sizes you ask for. Joe Mueller ...!nsc!nscpdc!joemu