aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorManuel López-Ibáñez <manu@gcc.gnu.org>2007-01-29 21:05:58 +0000
committerManuel López-Ibáñez <manu@gcc.gnu.org>2007-01-29 21:05:58 +0000
commitc616e51b000fcbc426ce51a92688c775493906e0 (patch)
treed2e910056e5bca216a5240901b18a528d2b8fe28 /gcc/c-decl.c
parent971005966f30c246ab1cfcaa537497a852d1be52 (diff)
downloadgcc-c616e51b000fcbc426ce51a92688c775493906e0.zip
gcc-c616e51b000fcbc426ce51a92688c775493906e0.tar.gz
gcc-c616e51b000fcbc426ce51a92688c775493906e0.tar.bz2
007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* c-decl.c (pop_scope): Replace warnings with call to warn_for_unused_label. * c-common.h (warn_for_unused_label): Declare. * c-common.c (warn_for_unused_label): Define. cp/ * decl.c (pop_label): Replace warning with call to warn_for_unused_label. From-SVN: r121310
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index f669a47..2f9ffc3 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -761,13 +761,9 @@ pop_scope (void)
error ("label %q+D used but not defined", p);
DECL_INITIAL (p) = error_mark_node;
}
- else if (!TREE_USED (p) && warn_unused_label)
- {
- if (DECL_INITIAL (p))
- warning (0, "label %q+D defined but not used", p);
- else
- warning (0, "label %q+D declared but not defined", p);
- }
+ else
+ warn_for_unused_label (p);
+
/* Labels go in BLOCK_VARS. */
TREE_CHAIN (p) = BLOCK_VARS (block);
BLOCK_VARS (block) = p;