Skip to main content

IAR Embedded Workbench for RL78 5.20

MISRAC++2008-0-1-11

In this section:
Synopsis

(Required) There shall be no unused parameters (named or unnamed) in nonvirtual functions.

Enabled by default

Yes

Severity/Certainty

Low/Medium

lowmedium.png
Full description

A function parameter is declared but not used. This check is identical to RED-unused-param, MISRAC2012-Rule-2.7.

Coding standards
CWE 563

Unused Variable

MISRA C:2012 Rule-2.7

(Advisory) There should be no unused parameters in functions

Code examples

The following code example fails the check and will give a warning:

int example(int x) {
  /* `x' is not used */
  return 20;
}

The following code example passes the check and will not give a warning about this issue:

int example(int x) {
  return x + 20;
}