A case of a switch falls through into the next one without saying so

tx0/cpp:fallthroughrecommendedwarningreliability/control-flowdepth fastbug

What it finds

A case of a switch whose statements run on into the next case, without break, return, goto or continue at their end: often a break was forgotten.

Falling through on purpose is marked with a comment that says so, such as /* fall through */ or // FALLTHRU, with the kernel's fallthrough;, with __attribute__((fallthrough)) or [[fallthrough]], or with a macro whose name says fallthrough, and those cases are left alone. So is a case whose last statement calls a function of the program, which may not return, or is a name alone, which may be a macro that jumps, one with a directive at its end, and one that falls into a case that only breaks.

From the rule's source, fallthrough.rs.

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/cpp:fallthrough" = "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/cpp:fallthrough] reason="..."

tx0 explain tx0/cpp:fallthrough shows the same in the terminal. Found a false positive? Report it.