Skip to main content

IAR Embedded Workbench for Arm 9.70.x

MISRAC2004-20.1

In this section:
Synopsis

(Required) Reserved identifiers, macros, and functions in the standard library shall not be defined, redefined, or undefined.

Enabled by default

Yes

Severity/Certainty

Low/Low

lowlow.png
Full description

Detected a #define or #undef of a reserved identifier in the standard library. This check is identical to MISRAC++2008-17-0-1, MISRAC2012-Rule-21.1.

Coding standards
MISRA C:2004 20.1

(Required) Reserved identifiers, macros, and functions in the standard library shall not be defined, redefined, or undefined.

MISRA C:2012 Rule-21.1

(Required) #define and #undef shall not be used on a reserved identifier or reserved macro name

MISRA C++ 2008 17-0-1

(Required) Reserved identifiers, macros and functions in the standard library shall not be defined, redefined or undefined.

Code examples

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

#define __TIME__ 11111111 /* Non-compliant */

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

#define A(x)	(x)	/* Compliant */