Article View: gnu.gcc.bug
Article #6214GCC 2.7.2 fails Sparc int comparison
From: Paul E. Campbell
Date: Fri, 12 Jan 1996 00:00
Date: Fri, 12 Jan 1996 00:00
22 lines
908 bytes
908 bytes
Not sure why this occurs..gcc 2.7.2 fails the following code fragment:
#include <stdio.h>
#include <limits.h>
main()
{
int testvalue=100;
printf("Is %d > %d ? [%d]\n", testvalue, INT_MIN, testvalue>INT_MIN);
printf("Is %d > %d ? [%d]\n", testvalue, -INT_MAX, testvalue>-INT_MAX);
return;
}
On the Sun (SunOS 4.1.3) here, the output is:
Is 100 > -2147483648 ? [0]
Is 100 > -2147483647 ? [1]
Clearly, it's not handling signed integers quite correctly.
Technical Details
Message-ID:
<4d62ea$m11@metlab4.my>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 113d02,8ada5312eecf8261,start X-Google-Attributes: gid113d02,public From: pecampbe@mtu.edu (Paul E. Campbell) Subject: GCC 2.7.2 fails Sparc int comparison Date: 1996/01/12 Message-ID: <4d62ea$m11@metlab4.my> X-Deja-AN: 134933731 distribution: gnu sender: daemon@cis.ohio-state.edu organization: Michigan Technological University newsgroups: gnu.gcc.bug