Control is transferred with setjmp and longjmp

tx0/cpp:setjmp-longjmpstrictwarningmaintainability/designdepth fastmaintainability

What it finds

longjmp jumps back into a function that called setjmp, past every function in between, which do not get to free what they hold, and local variables changed since the setjmp have unreliable values unless they are volatile.

From the rule's source, setjmp_longjmp.rs.

Turn it on, off or suppress it

The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/cpp:setjmp-longjmp" = "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:setjmp-longjmp] reason="..."

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