diff options
author | Mark Mitchell <mark@codesourcery.com> | 2003-04-15 16:35:52 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2003-04-15 16:35:52 +0000 |
commit | c8b718bae9f54b8c8d33a73546c632cd7568a8db (patch) | |
tree | 6da49ae9e9f06badf7779e4b16df23457fd91db9 /gcc/c-decl.c | |
parent | f5034c5eddf7f189bfdb60d984e1919875194b64 (diff) | |
download | gcc-c8b718bae9f54b8c8d33a73546c632cd7568a8db.zip gcc-c8b718bae9f54b8c8d33a73546c632cd7568a8db.tar.gz gcc-c8b718bae9f54b8c8d33a73546c632cd7568a8db.tar.bz2 |
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
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 50b7219..0614476 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -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. */ |