MISRAC++2008-8-4-2_a
In this section:
Synopsis
(Required) The identifiers used for the parameters in a re-declaration of a function shall be identical to those in the declaration.
Enabled by default
Yes
Severity/Certainty
Medium/Medium

Full description
Different names of the same parameter can lead to confusion when reading the code. This check is identical to MISRAC2004-16.4, MISRAC++2023-13.3.3_a.
This is a link analysis check.
Coding standards
- MISRA C:2004 16.4
(Required) The identifiers used in the declaration and definition of a function shall be identical.
- MISRA C++ 2023 13.3.3
(Required) The parameters in all declarations or overrides of a function shall either be unnamed or have identical names
Code examples
The following code example fails the check and will give a warning:
#include "example.h"
int foo(int b, int a)
{
return a + b;
}
The following code example passes the check and will not give a warning about this issue:
#include "example.h"
int pass_foo(int a, int b)
{
return foo(a,b);
}