A function's declaration and definition in the same file give a parameter different names

tx0/c:parameter-names-differrecommendedwarningstyle/namingdepth fastsmell

What it finds

int copy(char *dst, const char *src); and later int copy(char *src, const char *dst) { ... }: the names that document the parameters disagree, and either the declaration misleads its readers or the arguments were swapped.

Parameters left unnamed in the declaration are left alone, and so are declarations in branches of conditional directives.

From the rule's source, parameter_names_differ.rs.

Example from the rule's tests
int copy(char *dst, const char *src, int n); int copy(char *src, const char *dst, int n)tx0 reports: copy names this parameter dst in its declaration but src here{  for (int i = 0; i < n; i++)    src[i] = dst[i];  return n;}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

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

tx0.toml
[rules]
"tx0/c:parameter-names-differ" = "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:parameter-names-differ] reason="..."

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