Skip to main content

IAR Embedded Workbench for Arm 9.70.x

MISRAC++2008-16-2-2 (C++ only)

In this section:
Synopsis

(Required) C++ macros shall only be used for: include guards, type qualifiers, or storage class specifiers.

Enabled by default

Yes

Severity/Certainty

Low/Low

lowlow.png
Full description

Definitions of macros that are not include guards were found.

Coding standards

This check does not correspond to any coding standard rules.

Code examples

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

#define	X(Y)	(Y)	// Non-compliant

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

#include "header.h"	/* contains #ifndef HDR #define HDR ... #endif */
void example(void) {}