summaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authormanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-29 21:05:58 +0000
committermanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-29 21:05:58 +0000
commit92fccaaa535d5555bda8058c165fe3b2e0528c88 (patch)
treed2e910056e5bca216a5240901b18a528d2b8fe28 /gcc/c-decl.c
parente00076da6d4b2beea95861f41ef32d6aaac272d3 (diff)
downloadgcc-92fccaaa535d5555bda8058c165fe3b2e0528c88.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121310 138bc75d-0d04-0410-961f-82ee72b054a4
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 f669a4729da..2f9ffc3b622 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;