The condition of a while loop compares local variables that the loop never changes, so it runs forever or not at all

tx0/cpp:loop-condition-never-changesdefaulterrorreliability/control-flowdepth fastbug

What it finds

When nothing in the body assigns the variables of the condition, takes their address, passes them to a call or leaves the loop, the condition keeps its first value. A forgotten increment is the usual cause. Only plain local variables count, which nothing else can change.

From the rule's source, loop_condition_never_changes.rs.

Turn it on, off or suppress it

The rule runs in every tier. To turn it off for a project, set its level in tx0.toml:

tx0.toml
[rules]
"tx0/cpp:loop-condition-never-changes" = "off"

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:loop-condition-never-changes] reason="..."

tx0 explain tx0/cpp:loop-condition-never-changes shows the same in the terminal. Found a false positive? Report it.