Commit c8b718ba by Mark Mitchell Committed by Mark Mitchell

c-decl.c (implicitly_declare): Copy declarations that are going to be placed in a local scope.

	* c-decl.c (implicitly_declare): Copy declarations that are going
	to be placed in a local scope.

From-SVN: r65646
parent f5034c5e
2003-04-15 Mark Mitchell <mark@codesourcery.com>
* c-decl.c (implicitly_declare): Copy declarations that are going
to be placed in a local scope.
2003-04-15 James A. Morrison <ja2morri@uwaterloo.ca>
* invoke.texi (Spec Files): Wrap if-exists-else example.
......
......@@ -1872,7 +1872,13 @@ implicitly_declare (functionid)
warning_with_decl (decl, "previous declaration of `%s'");
C_DECL_IMPLICIT (decl) = 1;
}
return pushdecl (decl);
/* If this function is global, then it must already be in the
global binding level, so there's no need to push it again. */
if (current_binding_level == global_binding_level)
return decl;
/* If this is a local declaration, make a copy; we can't have
the same DECL listed in two different binding levels. */
return pushdecl (copy_node (decl));
}
/* Not seen before. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment