Path: 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 In article <1295@tuewsd.win.tue.nl> wsinpdb@lso.win.tue.nl (Paul de Bra) writes: >In sVr3.2 (on the 386) the file 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