Skip to main content

IAR Embedded Workbench for RH850 3.20.x

MISRAC2012-Rule-2.5

In this section:
Synopsis

(Advisory) A project should not contain unused macro declarations.

Enabled by default

No

Severity/Certainty

Low/Medium

lowmedium.png
Full description

An unused macro declaration was found.

This is a link analysis check.

Coding standards
MISRA C:2012 Rule-2.5

(Advisory) A project should not contain unused macro declarations

Code examples

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

#define M(x) (x + 1)

void example(void) {
  /* not invoking M */
}

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

#define M(x) (x + 1)

void example(void) {
  /* invoking M */
  int x = M(1);
}