The program ends with exit or quick_exit, which skip the destructors of local objects

tx0/cpp:exit-skips-destructorsstrictnotemaintainability/designdepth fastsmell

What it finds

std::exit runs the destructors of static objects but not of the objects on the stack, so files are not flushed and locks not released by their owners; quick_exit and _Exit skip even more. Returning from main, or throwing an exception that main handles, unwinds properly.

From the rule's source, exit_skips_destructors.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:exit-skips-destructors" = "note"

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:exit-skips-destructors] reason="..."

tx0 explain tx0/cpp:exit-skips-destructors shows the same in the terminal. Found a false positive? Report it.