Skip to main content

IAR Embedded Workbench for RISC-V 3.40

MISRAC++2023-0.2.2_b (C++ only)

In this section:
Synopsis

(Required) A named function parameter shall be used at least once

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 MISRAC++2008-0-1-12.

Coding standards
CWE 563

Unused Variable

MISRA C++ 2008 0-1-12

(Required) There shall be no unused parameters (named or unnamed) in the set of parameters for a virtual function and all the functions that override it.

Code examples

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

struct S {

virtual int example(int a, int b) {
  return a * a;
}

};

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

struct S {
  
virtual int example(int a, int b) {
  return a * b;
}

};