Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!abvax!iccgcc!browns From: browns@iccgcc.decnet.ab.com (Stan Brown) Newsgroups: comp.lang.c Subject: Re: Interesting Bug in Microsoft C Message-ID: <3621.27d4b987@iccgcc.decnet.ab.com> Date: 6 Mar 91 14:42:30 GMT References: <12541@pucc.Princeton.EDU> <17307@crdgw1.crd.ge.com> Lines: 15 In article <17307@crdgw1.crd.ge.com>, volpe@camelback.crd.ge.com (Christopher R Volpe) writes: > The compiler is correct. Using the constant "-2147483648L" is a bug > if "2147483648" is too big to fit in a long. C doesn't have negative > constants. It has positive constants preceded by the unary minus operator. > Thus, "-2147483648L" is not a constant, but an integral constant expression > containing a subexpression out of range. The correct way to code for this > value is, as you already noted, "-2147483647L-1". Would LONG_MIN (defined in ) not be superior to these magic numbers? I know LONG_MIN is not necessarily -214783648, but it has the virtue that it will compile. My opinions are mine: I don't speak for any other person or company. email (until 91/4/30): browns@iccgcc.decnet.ab.com Stan Brown, Oak Road Systems, Cleveland, Ohio, USA +1 216 371 0043