]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cppmacro.c (_cpp_create_definition): Don't attempt redefinition warnings on assertions.
authorNeil Booth <neil@daikokuya.co.uk>
Fri, 26 Jul 2002 16:29:31 +0000 (16:29 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Fri, 26 Jul 2002 16:29:31 +0000 (16:29 +0000)
* cppmacro.c (_cpp_create_definition): Don't attempt redefinition
warnings on assertions.

From-SVN: r55778

gcc/ChangeLog
gcc/cppmacro.c

index 21f149e4d15f54597b3df0440c93a227cffe0259..2dd43e6fe0f263634511218dec4d420c0514ced7 100644 (file)
@@ -1,3 +1,8 @@
+2002-07-26  Neil Booth  <neil@daikokuya.co.uk>
+
+       * cppmacro.c (_cpp_create_definition): Don't attempt redefinition
+       warnings on assertions.
+
 2002-07-26  Neil Booth  <neil@daikokuya.co.uk>
 
        * c-common.h (RID_AND, RID_AND_EQ, RID_NOT, RID_NOT_EQ,
index c8e2410af619e4ce4849f6fe83c3f25812fa011e..50cc9bbf4ba6fda3cc49a5421ff3356218533bc8 100644 (file)
@@ -1547,7 +1547,7 @@ _cpp_create_definition (pfile, node)
   if (!ok)
     return ok;
 
-  if (node->type != NT_VOID)
+  if (node->type == NT_MACRO)
     {
       if (CPP_OPTION (pfile, warn_unused_macros))
        _cpp_warn_if_unused_macro (pfile, node, NULL);
@@ -1562,9 +1562,11 @@ _cpp_create_definition (pfile, node)
                                 node->value.macro->line, 0,
                         "this is the location of the previous definition");
        }
-      _cpp_free_definition (node);
     }
 
+  if (node->type != NT_VOID)
+    _cpp_free_definition (node);
+
   /* Enter definition in hash table.  */
   node->type = NT_MACRO;
   node->value.macro = macro;