Article View: comp.bugs.sys5
Article #177Re: INT_MIN bug
From: karish
Date: Wed, 18 Jul 1990 17:49
Date: Wed, 18 Jul 1990 17:49
29 lines
1381 bytes
1381 bytes
In article <1295@tuewsd.win.tue.nl> wsinpdb@lso.win.tue.nl (Paul de Bra) writes:
>In sVr3.2 (on the 386) the file <limits.h> contains the definitions
>#define INT_MIN -2147483648
>and
>#define LONG_MIN -2147483648L
>
>which, according to K&R (second edition) are unsigned (constant) expressions
>in ANSI C.
K&R II, section B11, does not say that the values must be unsigned.
The C Standard specifically requires that they have the appropriate signs:
2.2.4.2, Numerical Limits
The values given below shall be replaced by constant expressions
suitable for use in #if preprocessing directives. Their
implementation-defined values shall be equal or greater in
magnitude (absolute value) to those shown, with the same sign.
[ ... ]
INT_MIN -32767
LONG_MIN -2147483647
--
Chuck Karish karish@mindcraft.com
Mindcraft, Inc. (415) 323-9000
Technical Details
Message-ID:
<9007181749.AA16031@mindcrf.mindcraft.com>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!tut.cis.ohio-state.edu!ucbvax!mindcrf.UUCP!karishReferences:
<1295@tuewsd.win.tue.nl>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!tut.cis.ohio-state.edu!ucbvax!mindcrf.UUCP!karish From: karish@mindcrf.UUCP Newsgroups: comp.bugs.sys5 Subject: Re: INT_MIN bug Summary: Looks OK to me Keywords: negative constants, overflow Message-ID: <9007181749.AA16031@mindcrf.mindcraft.com> Date: 18 Jul 90 17:49:09 GMT References: <1295@tuewsd.win.tue.nl> Sender: daemon@ucbvax.BERKELEY.EDU Organization: Mindcraft, Inc. Lines: 29