Message: Function 'func2' argument order different: declaration 'a, b, c' definition 'c, b, a'
Category: Code Quality
Severity: Warning
Language: C/C++
A function's declaration and its definition give the same set of argument names, but in a different order - a strong sign that a maintenance edit swapped two parameters in only one of the two places.
If the declaration and definition disagree about which parameter is which, calls written against the declaration pass arguments in the wrong logical order relative to what the definition actually does with them - a real, easy-to-miss bug, not just a style nit.
Before:
void func2(int a, int b, int c);
void func2(int c, int b, int a) { } // <- 'a' and 'c' swapped placesAfter:
void func2(int a, int b, int c);
void func2(int a, int b, int c) { }- funcArgNamesDifferent.md - the same kind of declaration/definition mismatch, but for an argument name changing (or disappearing) rather than two arguments swapping order.