Fix bug where static forward declarations weren't accepted.

This allows us to fix non-ISO-C constructs in our kernel to legal ISO-C.

Submitted by:	rodrigc
Obtained from:	http://gcc.gnu.org/ml/gcc-patches/2005-09/msg00006.html
This commit is contained in:
David E. O'Brien 2005-09-07 09:23:39 +00:00
parent 60fc1eb79c
commit d109621656

View File

@ -1264,7 +1264,10 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
&& !(DECL_EXTERNAL (olddecl) && !DECL_EXTERNAL (newdecl))
/* Don't warn about forward parameter decls. */
&& !(TREE_CODE (newdecl) == PARM_DECL
&& TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl)))
&& TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl))
/* Don't warn about a variable definition following a declaration. */
&& !(TREE_CODE (newdecl) == VAR_DECL
&& DECL_INITIAL (newdecl) && !DECL_INITIAL (olddecl)))
{
warning ("%Jredundant redeclaration of '%D'", newdecl, newdecl);
warned = true;