c++/6568: g++3 (3.0.2) misinterpreting single byte hex constants

Neil Booth neil@daikokuya.demon.co.uk
Mon May 6 08:22:00 GMT 2002


Brian Ceccarelli wrote:-

>    i = 0;
>    n = (-1);
> 
>    printf("sizeof(i) = %d\n", sizeof i);
>    printf("sizeof(n) = %d\n", sizeof n);
> 
>    if (n == 0xFF)
>       printf("Yes.  n = 0x%x\n", n);
>    else
>       printf("No.  n = 0x%x\n", n);

Please explain why your test should give "Yes".  I think
"No" is correct.

Neil.



More information about the Gcc-bugs mailing list