aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/c-decl.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/c/c-decl.cc b/gcc/c/c-decl.cc
index 9159965..e537d33 100644
--- a/gcc/c/c-decl.cc
+++ b/gcc/c/c-decl.cc
@@ -1310,7 +1310,10 @@ pop_scope (void)
&& scope != external_scope)
{
if (!TREE_USED (p))
- warning (OPT_Wunused_variable, "unused variable %q+D", p);
+ {
+ warning (OPT_Wunused_variable, "unused variable %q+D", p);
+ suppress_warning (p, OPT_Wunused_variable);
+ }
else if (DECL_CONTEXT (p) == current_function_decl)
warning_at (DECL_SOURCE_LOCATION (p),
OPT_Wunused_but_set_variable,