From f10f9e157df69587deabcf0e09f550bdd76c31a7 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 11 Mar 2020 13:33:06 +0900 Subject: [PATCH] [qfcc] Warn about unused labels --- tools/qfcc/source/statements.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/qfcc/source/statements.c b/tools/qfcc/source/statements.c index f82fa552e..517fcc7b3 100644 --- a/tools/qfcc/source/statements.c +++ b/tools/qfcc/source/statements.c @@ -1344,7 +1344,11 @@ statement_label (sblock_t *sblock, expr_t *e) e->e.label.next = sblock->labels; sblock->labels = &e->e.label; } else { - debug (e, "dropping unused label %s", e->e.label.name); + if (e->e.label.symbol) { + warning (e, "unused label %s", e->e.label.symbol->name); + } else { + debug (e, "dropping unused label %s", e->e.label.name); + } } return sblock; }