aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-04-26 17:56:19 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-04-26 17:56:19 -0400
commitdb8717d93b031ae41252ef8edc3a4a958233fa94 (patch)
tree3bcaab73db0798ec7449abd54e39548157b79a91
parent3fc341ac09fb135beac6be43367d5daa8f7c7d90 (diff)
downloadgcc-db8717d93b031ae41252ef8edc3a4a958233fa94.zip
gcc-db8717d93b031ae41252ef8edc3a4a958233fa94.tar.gz
gcc-db8717d93b031ae41252ef8edc3a4a958233fa94.tar.bz2
(expand_function_end): Warn about unused parms if both -Wunused and -W.
From-SVN: r9489
-rw-r--r--gcc/function.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 6a936ff..83a6962 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -5234,18 +5234,16 @@ expand_function_end (filename, line, end_bindings)
emit_insns_before (seq, tail_recursion_reentry);
}
-#if 0 /* I think unused parms are legitimate enough. */
- /* Warn about unused parms. */
- if (warn_unused)
+ /* Warn about unused parms if extra warnings were specified. */
+ if (warn_unused && extra_warnings)
{
- rtx decl;
+ tree decl;
for (decl = DECL_ARGUMENTS (current_function_decl);
decl; decl = TREE_CHAIN (decl))
- if (! TREE_USED (decl) && TREE_CODE (decl) == VAR_DECL)
+ if (! TREE_USED (decl) && TREE_CODE (decl) == PARM_DECL)
warning_with_decl (decl, "unused parameter `%s'");
}
-#endif
/* Delete handlers for nonlocal gotos if nothing uses them. */
if (nonlocal_goto_handler_slot != 0 && !current_function_has_nonlocal_label)