[qfcc] Warn about unused labels

This commit is contained in:
Bill Currie 2020-03-11 13:33:06 +09:00
parent 393e540ffa
commit f10f9e157d

View file

@ -1343,9 +1343,13 @@ statement_label (sblock_t *sblock, expr_t *e)
e->e.label.dest = sblock; e->e.label.dest = sblock;
e->e.label.next = sblock->labels; e->e.label.next = sblock->labels;
sblock->labels = &e->e.label; sblock->labels = &e->e.label;
} else {
if (e->e.label.symbol) {
warning (e, "unused label %s", e->e.label.symbol->name);
} else { } else {
debug (e, "dropping unused label %s", e->e.label.name); debug (e, "dropping unused label %s", e->e.label.name);
} }
}
return sblock; return sblock;
} }