diff options
author | Bernardo Innocenti <bernie@develer.com> | 2004-07-26 02:38:05 +0200 |
---|---|---|
committer | Bernardo Innocenti <bernie@gcc.gnu.org> | 2004-07-26 02:38:05 +0200 |
commit | 1ad463f4932ebb6224f1155bced2dda6aedd686f (patch) | |
tree | b7381c551208f9e8237f512d0342d34a886d0c9a /gcc/c-decl.c | |
parent | f408614568706ffddfbdfc7a947bb2f39a99d23a (diff) | |
download | gcc-1ad463f4932ebb6224f1155bced2dda6aedd686f.tar.gz |
c-common.c (disable_builtin_function): Rename variable n to new_disabled_builtin.
* c-common.c (disable_builtin_function): Rename variable n to
new_disabled_builtin.
* c-decl.c (duplicate_decls): Rename parameter decl to new_decl.
Rename local variable old to old_decl.
* gensupport.c (shift_output_template): Rename parameter old to src.
* simplify-rtx.c (simplify_replace_rtx): Rename parameter oldx to
old_rtx and newx to new_rtx.
From-SVN: r85175
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index e4c022ff25e..3239817da2b 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -1733,45 +1733,49 @@ duplicate_decls (tree newdecl, tree olddecl) } -/* Check whether decl-node DECL shadows an existing declaration. */ +/* Check whether decl-node NEW_DECL shadows an existing declaration. */ static void -warn_if_shadowing (tree decl) +warn_if_shadowing (tree new_decl) { struct c_binding *b; /* Shadow warnings wanted? */ if (!warn_shadow /* No shadow warnings for internally generated vars. */ - || DECL_IS_BUILTIN (decl) + || DECL_IS_BUILTIN (new_decl) /* No shadow warnings for vars made for inlining. */ - || DECL_FROM_INLINE (decl) + || DECL_FROM_INLINE (new_decl) /* Don't warn about the parm names in function declarator within a function declarator. It would be nice to avoid warning in any function declarator in a declaration, as opposed to a definition, but there is no way to tell it's not a definition at this point. */ - || (TREE_CODE (decl) == PARM_DECL && current_scope->outer->parm_flag)) + || (TREE_CODE (new_decl) == PARM_DECL && current_scope->outer->parm_flag)) return; /* Is anything being shadowed? Invisible decls do not count. */ - for (b = I_SYMBOL_BINDING (DECL_NAME (decl)); b; b = b->shadowed) - if (b->decl && b->decl != decl && !b->invisible) + for (b = I_SYMBOL_BINDING (DECL_NAME (new_decl)); b; b = b->shadowed) + if (b->decl && b->decl != new_decl && !b->invisible) { - tree old = b->decl; + tree old_decl = b->decl; - if (TREE_CODE (old) == PARM_DECL) - warning ("%Jdeclaration of '%D' shadows a parameter", decl, decl); - else if (DECL_FILE_SCOPE_P (old)) + if (TREE_CODE (old_decl) == PARM_DECL) + warning ("%Jdeclaration of '%D' shadows a parameter", + new_decl, new_decl); + else if (DECL_FILE_SCOPE_P (old_decl)) warning ("%Jdeclaration of '%D' shadows a global declaration", - decl, decl); - else if (TREE_CODE (old) == FUNCTION_DECL && DECL_BUILT_IN (old)) + new_decl, new_decl); + else if (TREE_CODE (old_decl) == FUNCTION_DECL + && DECL_BUILT_IN (old_decl)) warning ("%Jdeclaration of '%D' shadows a built-in function", - decl, decl); + new_decl, new_decl); else - warning ("%Jdeclaration of '%D' shadows a previous local", decl, decl); + warning ("%Jdeclaration of '%D' shadows a previous local", + new_decl, new_decl); - if (TREE_CODE (old) != FUNCTION_DECL || !DECL_BUILT_IN (old)) - warning ("%Jshadowed declaration is here", old); + if (TREE_CODE (old_decl) != FUNCTION_DECL + || ! DECL_BUILT_IN (old_decl)) + warning ("%Jshadowed declaration is here", old_decl); break; } |