A function-like macro computes a value that a function could compute

tx0/c:function-like-macroallwarningmaintainability/designdepth fastmaintainability

What it finds

#define SQUARE(x) ((x) * (x)): a macro evaluates its arguments as often as they occur, has no type checking and cannot be stepped into; a static inline function does the same job safely.

Only macros whose body is a plain expression count: macros that paste or quote tokens, take a variable number of arguments, contain statements or keywords of types, or use a parameter as a type or a member name, need to be macros.

From the rule's source, function_like_macro.rs.

Turn it on, off or suppress it

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

tx0.toml
[rules]
"tx0/c:function-like-macro" = "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:function-like-macro] reason="..."

tx0 explain tx0/c:function-like-macro shows the same in the terminal. Found a false positive? Report it.