A label is never the target of a goto
What it finds
A label that no goto names is noise, and often a sign that the goto meant for it names another label.
The name must occur nowhere else in the code of the file, also not in macros or in branches of conditional directives that are not read. A file whose macros paste tokens with ## is left alone, since they can make any name.
From the rule's source, unused_label.rs.
int run(int n){ if (n) goto out; n++;spare:tx0 reports: the label spare is never used n--;out: return n;} Turn it on, off or suppress it
The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/c:unused-label" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/c:unused-label] reason="..."tx0 explain tx0/c:unused-label shows the same in the terminal. Found a false positive? Report it.