This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

other/823: gcc -U does not undef a macro



>Number:         823
>Category:       other
>Synopsis:       preprocessor -U does not undef a macro
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 16 15:36:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Richard Earnshaw
>Release:        2.97 20001114 (experimental)
>Organization:
ARM
>Environment:
System: NetBSD buzzard.buzzard.freeserve.co.uk 1.5I NetBSD 1.5I (BUZZARD) #215: Mon Nov 6 00:20:40 GMT 2000 rearnsha@buzzard.buzzard.freeserve.co.uk:/usr/src/sys/arch/arm32/compile/BUZZARD arm32


	
host: arm-unknown-netbsd1.4
build: arm-unknown-netbsd1.4
target: arm-unknown-netbsd1.4
configured with:  : (reconfigured) /home/rearnsha/gnusrc/egcs/configure --with-gcc-version-trigger=/home/rearnsha/gnusrc/egcs/gcc/version.c --host=arm-netbsd1.4 --prefix=/mnt2/home/rearnsha/gnu/install
>Description:
	gcc -Dfoo -Ufoo does not undefine foo during preprocessing.  This
	breaks Imakefiles in the XFree86 distribution.
	
>How-To-Repeat:
	$ cat > undef.c << EOF
		#ifdef foo
		#error foo should not be defined
		#endif
	EOF
	$ gcc -E undef.c
	# 1 "undef.c"
	$ gcc -Dfoo -Ufoo -E undef.c
	# 1 "undef.c"
	undef.c:2:2: #error xxx

	Adding -v to the command shows that the -U and -D arguments have
	been reversed.

	/mnt2/home/rearnsha/gnu/install/lib/gcc-lib/arm-netbsd1.4/2.97/cpp0 -lang-c -v -D__GNUC__=2 -D__GNUC_MINOR__=97 -D__GNUC_PATCHLEVEL__=0 -Dunix -Driscbsd -Darm32 -D__arm32__ -D__arm__ -D__NetBSD__ -D__unix__ -D__riscbsd__ -D__arm32__ -D__arm32__ -D__arm__ -D__NetBSD__ -D__unix -D__riscbsd -D__arm32 -Asystem=unix -Asystem=NetBSD -Acpu=arm -Amachine=arm -D__CHAR_UNSIGNED__ -D__STDC_HOSTED__=1 -D__ARM_ARCH_3__ -D__APCS_32__ -D__SOFTFP__ -D__ARMEL__ -Ufoo -Dfoo undef.c


	
>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]