A label is never the target of a goto

tx0/c:unused-labelrecommendedwarningsmell

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.

Example from the rule's tests
int run(int n){  if (n)    goto out;  n++;spare:tx0 reports: the label spare is never used  n--;out:  return n;}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

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:

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.