Interesting Bug in Microsoft C

Chris Torek torek at elf.ee.lbl.gov
Tue Mar 5 11:07:05 AEST 1991


In article <12541 at pucc.Princeton.EDU> EGNILGES at pucc.Princeton.EDU writes:
>A colleague wrote a program containing the value -2,147,483,648L (-2**31)
>which compiled and ran on Borland Turbo-C but produced a diagnostic "con-
>stant to long" on Microsoft QuickC.  When he changed it, replacing
>the value with -2,147,483,647L - 1 the program ran on QuickC.

If this is a warning, not an error, the compiler is merely being helpful.

The type and value of

	-2147483648L

on a machine with 32-bit `long's is

	<unsigned long, 2147483648UL>

See X3.159-1989 for details.
-- 
In-Real-Life: Chris Torek, Lawrence Berkeley Lab EE div (+1 415 486 5427)
Berkeley, CA		Domain:	torek at ee.lbl.gov



More information about the Comp.lang.c mailing list