aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-07-06 06:12:49 +0000
committerRichard Stallman <rms@gnu.org>1993-07-06 06:12:49 +0000
commitec820a12da7933bc7aa900ff4d5ace82ba821d13 (patch)
treecb31fa0167021dae23d3d8418a9124620d5be12f /gcc
parent3abe6f904a6f63df38ad7c3304bf8d42c03b3044 (diff)
downloadgcc-ec820a12da7933bc7aa900ff4d5ace82ba821d13.zip
gcc-ec820a12da7933bc7aa900ff4d5ace82ba821d13.tar.gz
gcc-ec820a12da7933bc7aa900ff4d5ace82ba821d13.tar.bz2
(duplicate_decls): Don't warn for non-extern var decl
following an extern one (for -Wredundant-decls). From-SVN: r4856
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-decl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index e9b2e5b..77c5f48 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -1589,7 +1589,9 @@ duplicate_decls (newdecl, olddecl)
/* Dont warn about a function declaration
followed by a definition. */
&& !(TREE_CODE (newdecl) == FUNCTION_DECL && DECL_INITIAL (newdecl) != 0
- && DECL_INITIAL (olddecl) == 0))
+ && DECL_INITIAL (olddecl) == 0)
+ /* Don't warn about extern decl followed by (tentative) definition. */
+ && !(DECL_EXTERNAL (olddecl) && ! DECL_EXTERNAL (newdecl)))
{
warning_with_decl (newdecl, "redundant redeclaration of `%s' in same scope");
warning_with_decl (olddecl, "previous declaration of `%s'");