Skip to main content

IAR Embedded Workbench for RH850 3.20.x

MISRAC2004-5.7

In this section:
Synopsis

(Advisory) No identifier name should be reused.

Enabled by default

No

Severity/Certainty

Low/Low

lowlow.png
Full description

An identifier in a variable, enumeration, struct, #define, or union definition is reused.

This is a link analysis check.

Coding standards
MISRA C:2004 5.7

(Advisory) No identifier name should be reused.

Code examples

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

void example(void) {
	struct {
		int x;
	} name1;
	struct {
		int x; // x is reused here
	} name2;
}

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

void example(void) {
	struct {
		int x;
	} name1;
	struct {
		int y;
	} name2;
}