mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-24 19:59:44 +08:00
cppmacro.c (warn_of_redefinition): Warn regardless of -pedantic.
* cppmacro.c (warn_of_redefinition): Warn regardless of -pedantic. * gcc.dg/cpp/mi6.c, gcc.dg/cpp/redef2.c: Update. From-SVN: r47282
This commit is contained in:
parent
8d49efb017
commit
f26311c174
@ -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.
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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 } */
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user