Skip to main content

IAR Embedded Workbench for RX 5.20

MISRAC2012-Rule-2.6

In this section:
Synopsis

(Advisory) A function should not contain unused label declarations.

Enabled by default

No

Severity/Certainty

Medium/Medium

mediummedium.png
Full description

A function was found that contains an unused label declaration.

Coding standards
MISRA C:2012 Rule-2.6

(Advisory) A function should not contain unused label declarations

Code examples

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

void example(void) {
unusedlabel:
}

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

void skip_funcion_call(void);

void example(void) {
	goto usedlabel;
	skip_funcion_call();
usedlabel:
}