public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Neil Booth <neil@daikokuya.demon.co.uk>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: preprocessor/4902: no macro redef warnings
Date: Mon, 19 Nov 2001 09:46:00 -0000	[thread overview]
Message-ID: <20011123075602.9225.qmail@sourceware.cygnus.com> (raw)

The following reply was made to PR preprocessor/4902; it has been noted by GNATS.

From: Neil Booth <neil@daikokuya.demon.co.uk>
To: gcc-patches@gcc.gnu.org
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: preprocessor/4902: no macro redef warnings
Date: Fri, 23 Nov 2001 07:52:50 +0000

 This fixes the complaint of PR 4902 where we would only warn of
 non-trivial macro redefinitions if -pedantic.  Now we always warn,
 which is what we used to do.  It's not clear why this changed.
 
 I'll put a similar thing in the branch soon.
 
 Neil.
 
 	* cppmacro.c (warn_of_redefinition): Warn regardless of -pedantic.
 	* gcc.dg/cpp/mi6.c, gcc.dg/cpp/redef2.c: Update.
 
 Index: cppmacro.c
 ===================================================================
 RCS file: /cvs/gcc/gcc/gcc/cppmacro.c,v
 retrieving revision 1.85
 diff -u -p -r1.85 cppmacro.c
 --- cppmacro.c	2001/11/19 21:04:48	1.85
 +++ cppmacro.c	2001/11/23 07:44:42
 @@ -1124,9 +1124,6 @@ warn_of_redefinition (pfile, node, macro
    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;
 Index: testsuite/gcc.dg/cpp/redef2.c
 ===================================================================
 RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/cpp/redef2.c,v
 retrieving revision 1.4
 diff -u -p -r1.4 redef2.c
 --- redef2.c	2001/09/30 10:03:11	1.4
 +++ redef2.c	2001/11/23 07:44:42
 @@ -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 } */ 
 +*/
 Index: testsuite/gcc.dg/cpp/mi6.c
 ===================================================================
 RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/cpp/mi6.c,v
 retrieving revision 1.2
 diff -u -p -r1.2 mi6.c
 --- mi6.c	2001/10/01 10:04:36	1.2
 +++ mi6.c	2001/11/23 07:44:42
 @@ -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


             reply	other threads:[~2001-11-23  7:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-19  9:46 Neil Booth [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-11-19  9:56 neil
2001-11-19  9:48 neil
2001-11-16 23:46 Neil Booth
2001-11-15  8:16 Zack Weinberg
2001-11-15  7:46 Neil Booth
2001-11-13 15:26 Golubev I. N.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20011123075602.9225.qmail@sourceware.cygnus.com \
    --to=neil@daikokuya.demon.co.uk \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).