The body of a macro ends in a semicolon, which uses add another of their own
What it finds
#define RESET(x) (x) = 0;: the body ends in a semicolon, so RESET(a); is two statements, and if (c) RESET(a); else ... does not compile because the empty statement ends the if. The use supplies the semicolon.
From the rule's source, macro_trailing_semicolon.rs.
#define RESET(x) (x) = 0;tx0 reports: the body of RESET ends in a semicolon#define CLEAR(x) ((x) = 0)int x; 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:
[rules]
"tx0/c:macro-trailing-semicolon" = "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/c:macro-trailing-semicolon] reason="..."tx0 explain tx0/c:macro-trailing-semicolon shows the same in the terminal. Found a false positive? Report it.