cppmacro.c (_cpp_create_definition): Don't attempt redefinition warnings on assertions.

* cppmacro.c (_cpp_create_definition): Don't attempt redefinition
	warnings on assertions.

From-SVN: r55778
This commit is contained in:
Neil Booth 2002-07-26 16:29:31 +00:00 committed by Neil Booth
parent c372b0fa93
commit c2734e0563
2 changed files with 9 additions and 2 deletions

View 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> 2002-07-26 Neil Booth <neil@daikokuya.co.uk>
* c-common.h (RID_AND, RID_AND_EQ, RID_NOT, RID_NOT_EQ, * c-common.h (RID_AND, RID_AND_EQ, RID_NOT, RID_NOT_EQ,

View File

@ -1547,7 +1547,7 @@ _cpp_create_definition (pfile, node)
if (!ok) if (!ok)
return ok; return ok;
if (node->type != NT_VOID) if (node->type == NT_MACRO)
{ {
if (CPP_OPTION (pfile, warn_unused_macros)) if (CPP_OPTION (pfile, warn_unused_macros))
_cpp_warn_if_unused_macro (pfile, node, NULL); _cpp_warn_if_unused_macro (pfile, node, NULL);
@ -1562,9 +1562,11 @@ _cpp_create_definition (pfile, node)
node->value.macro->line, 0, node->value.macro->line, 0,
"this is the location of the previous definition"); "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. */ /* Enter definition in hash table. */
node->type = NT_MACRO; node->type = NT_MACRO;
node->value.macro = macro; node->value.macro = macro;