preprocessor/3824: With -traditional, CPP 0xffffffff > 0 but C 0xffffffff < 0
Wed Jul 25 14:06:00 GMT 2001

>Number:         3824
>Category:       preprocessor
>Synopsis:       With -traditional, CPP 0xffffffff > 0 but C 0xffffffff < 0
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 25 14:06:00 PDT 2001
>Originator:     Hallvard B Furuseth
>Release:        3.0
System: SunOS 5.8 Generic_108528-03 sun4u sparc SUNW,Ultra-5_10
Architecture: sun4

host: sparc-sun-solaris2.8
build: sparc-sun-solaris2.8
target: sparc-sun-solaris2.8
configured with: ./configure --quiet --enable-version-specific-runtime-libs --prefix=/usit/bombur/hbf --program-suffix=-3.0
	With gcc -traditional and 32-bit int/long,
	0xffffffff is positive in the preprocessor but negative in C.

	bash$ cat a.c
extern int puts();
int main()
#if 0xffffffff < 0
    puts(0xffffffff < 0 ? "c:negative" : "c:positive");
    return 0;
	bash$ gcc3 -traditional a.c && ./a.out


More information about the Gcc-bugs mailing list