draft ANSI standard: one change that would *really* help Europe
Joe Mueller
joemu at nscpdc.NSC.COM
Thu Dec 18 04:11:32 AEST 1986
In article <1715 at batcomputer.tn.cornell.edu>, braner at 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
More information about the Comp.lang.c
mailing list