The following program outputs "FAIL" when compiled with g++, but "PASS"
when compiled with gcc (on IA32):
#include <stdio.h>
int main(void) {
short a = 0x1a10;
short b = 0xb34e;
if((unsigned int)a >= (unsigned int)b)
printf("FAIL\n");
else printf("PASS\n");
return 0;
}
When using g++, the variable "b" seems to be treated as a negative
number even though it is cast to unsigned int. Is this a bug? Any
ideas?
Versions:
g++ (GCC) 3.2.3 20030502
gcc (GCC) 3.2.3 20030502
Thanks,
Erik
_______________________________________________
Help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus