diff options
| author | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-11-23 07:50:42 +0000 |
|---|---|---|
| committer | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-11-23 07:50:42 +0000 |
| commit | 5eb421aa2146efde7ff42e4364a08f5fdd90735e (patch) | |
| tree | 10016d04f01992816df554bf3a61199c3f6ad534 | |
| parent | 27c4c5c0d27bae150287a587caeb9296552eb44f (diff) | |
| download | ppe42-gcc-5eb421aa2146efde7ff42e4364a08f5fdd90735e.tar.gz ppe42-gcc-5eb421aa2146efde7ff42e4364a08f5fdd90735e.zip | |
* cppmacro.c (warn_of_redefinition): Warn regardless of -pedantic.
* gcc.dg/cpp/mi6.c, gcc.dg/cpp/redef2.c: Update.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47282 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/cppmacro.c | 3 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.dg/cpp/mi6.c | 5 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.dg/cpp/redef2.c | 6 |
4 files changed, 12 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0217226f98c..a84ebf96095 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-11-23 Neil Booth <neil@daikokuya.demon.co.uk> + + * cppmacro.c (warn_of_redefinition): Warn regardless of -pedantic. + * gcc.dg/cpp/mi6.c, gcc.dg/cpp/redef2.c: Update. + 2001-11-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * cris.h: Revert thinko in last patch. diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c index 17dfe1566b0..403920c03a3 100644 --- a/gcc/cppmacro.c +++ b/gcc/cppmacro.c @@ -1124,9 +1124,6 @@ warn_of_redefinition (pfile, node, macro2) if (node->flags & NODE_WARN) return 1; - if (! CPP_PEDANTIC (pfile)) - return 0; - /* Redefinition of a macro is allowed if and only if the old and new definitions are the same. (6.10.3 paragraph 2). */ macro1 = node->value.macro; diff --git a/gcc/testsuite/gcc.dg/cpp/mi6.c b/gcc/testsuite/gcc.dg/cpp/mi6.c index f35590085d0..aa1c8ed2ec5 100644 --- a/gcc/testsuite/gcc.dg/cpp/mi6.c +++ b/gcc/testsuite/gcc.dg/cpp/mi6.c @@ -29,10 +29,15 @@ /* Define the macro guard, and redefine the macros to something that forces compilation of the conditional blocks. */ #define guard +#undef EMPTYL #define EMPTYL 1 || +#undef EMPTYR #define EMPTYR || 1 +#undef NOT #define NOT +#undef DEFINED #define DEFINED 0 +#undef NOT_DEFINED #define NOT_DEFINED 1 #define VAR five diff --git a/gcc/testsuite/gcc.dg/cpp/redef2.c b/gcc/testsuite/gcc.dg/cpp/redef2.c index 7001d67eb00..b0068d91626 100644 --- a/gcc/testsuite/gcc.dg/cpp/redef2.c +++ b/gcc/testsuite/gcc.dg/cpp/redef2.c @@ -1,7 +1,7 @@ /* Test for redefining macros with significant differences. */ /* { dg-do preprocess } - { dg-options "-ansi -pedantic -Wall -fno-show-column" } */ + { dg-options "-ansi -Wall -fno-show-column" } */ #define mac(a, b) (a) + (b) #define mac(a, b) (a) * (b) @@ -28,6 +28,4 @@ { dg-warning "previous" "prev def mac" { target *-*-* } 8 } { dg-warning "previous" "prev def ro" { target *-*-* } 11 } { dg-warning "previous" "prev def va" { target *-*-* } 14 } - - { dg-warning "named var" "named variadic" { target *-*-* } 14 } - { dg-warning "anonymous var" "anon variadic" { target *-*-* } 15 } */ +*/ |

