Thread View: gnu.gcc.bug
1 messages
1 total messages
Started by Paul E. Campbell
Fri, 12 Jan 1996 00:00
GCC 2.7.2 fails Sparc int comparison
Author: 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.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads