Commit ec820a12 by Richard Stallman

(duplicate_decls): Don't warn for non-extern var decl

following an extern one (for -Wredundant-decls).

From-SVN: r4856
parent 3abe6f90
...@@ -1589,7 +1589,9 @@ duplicate_decls (newdecl, olddecl) ...@@ -1589,7 +1589,9 @@ duplicate_decls (newdecl, olddecl)
/* Dont warn about a function declaration /* Dont warn about a function declaration
followed by a definition. */ followed by a definition. */
&& !(TREE_CODE (newdecl) == FUNCTION_DECL && DECL_INITIAL (newdecl) != 0 && !(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 (newdecl, "redundant redeclaration of `%s' in same scope");
warning_with_decl (olddecl, "previous declaration of `%s'"); warning_with_decl (olddecl, "previous declaration of `%s'");
......
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