A parameter of a function definition is never used in its body

tx0/c:unused-parameterstrictwarningmaintainability/dead-codedepth fastsmell

What it finds

A function definition with a parameter whose name occurs nowhere in its body: callers pass a value that does nothing, which may mean the function forgot to use it. Functions that must have a given signature, as callbacks do, can leave the parameter unnamed or mark it, (void)name; or an attribute with unused in it, to say so.

The name must occur nowhere in the body, also not in macros or branches of conditional directives that are not read. Empty bodies are left alone, since stubs take parameters by design.

Only static functions of a source file count whose name occurs in it only where they are called. A function whose address is taken, stored in a table of callbacks or passed to a macro, or one that other files can call, likely has its signature given by its callers, and the parameter is there for them.

From the rule's source, unused_parameter.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/c:unused-parameter" = "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:unused-parameter] reason="..."

tx0 explain tx0/c:unused-parameter shows the same in the terminal. Found a false positive? Report it.