A parameter of a macro is used next to an operator without parentheses around it

tx0/cpp:macro-parameter-unparenthesizedstrictwarningreliability/logicdepth fastbug

What it finds

#define SQUARE(x) x * x: the argument replaces the parameter as text, so SQUARE(a + 1) becomes a + 1 * a + 1. Parentheses around each use of the parameter, (x) * (x), keep the argument whole.

The body must consist only of names, integer literals, parentheses and arithmetic or bitwise operators, so that it is an expression and not a statement or a declaration.

From the rule's source, macro_parameter_unparenthesized.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:macro-parameter-unparenthesized" = "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:macro-parameter-unparenthesized] reason="..."

tx0 explain tx0/cpp:macro-parameter-unparenthesized shows the same in the terminal. Found a false positive? Report it.