Skip to main content

IAR Embedded Workbench for RISC-V 3.40

MISRAC++2023-13.3.3_a

In this section:
Synopsis

(Required) The parameters in all declarations or overrides of a function shall either be unnamed or have identical names

Enabled by default

Yes

Severity/Certainty

Medium/Medium

mediummedium.png
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++2008-8-4-2_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.

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);
}