Skip to main content

IAR Embedded Workbench for Arm 9.70.x

MISRAC2012-Rule-2.8_b

In this section:
Synopsis

(Advisory) A project should not contain unused Object definitions.

Enabled by default

No

Severity/Certainty

Low/Medium

lowmedium.png
Full description

Unused internal object definition.

This is a link analysis check.

Coding standards
MISRA C:2012 Rule-2.8

(Advisory) A project should not contain unused Object definitions

Code examples

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

static int unused_var; /* Non-compliant */

void example(void) {
}

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

static int used_var; /* Compliant */

int example(void) {
  return used_var; 
}