11022 – [3.3 regression] no warning for non-compatible macro redefine (original) (raw)

Description Loren Rittle 2003-05-29 02:42:45 UTC

Also seen on sparc-sun-solaris2.7 (3.3 prerelease). Preprocess the following self-contained test (yet not preprocessed for obvious reasons):

#define FOO #define FOO 1 #define FOO #define FOO 2

gcc 3.2.X and before used to warn about this. If you delete the third line, gcc 3.3 will warn about it as expected.

Comment 1 Drea Pinski 2003-05-29 03:13:45 UTC

I can confirm this on 3.3 branch (20030526) and mainline (20030528): tin:/src/gnu/gcctest>/ia32_linux_gcc3_3/bin/gcc -Wall -W pr11022.c -c tin:~/src/gnu/gcctest>gcc -Wall -W pr11022.c -c

tin:/src/gnu/gcctest>/ia32_linux_gcc3_2/bin/gcc -Wall -W pr11022.c -c pr11022.c:2:1: warning: "FOO" redefined pr11022.c:1:1: warning: this is the location of the previous definition pr11022.c:3:1: warning: "FOO" redefined pr11022.c:2:1: warning: this is the location of the previous definition pr11022.c:4:1: warning: "FOO" redefined pr11022.c:3:1: warning: this is the location of the previous definition

Comment 3 Drea Pinski 2003-06-02 03:54:33 UTC

Should this patch be also approved for 3.3?

Comment 6 Neil Booth 2003-06-19 05:40:43 UTC

Fix backported from 3.4.