Skip to main content

IAR Embedded Workbench for RISC-V 3.40

MISRAC++2008-2-7-3

In this section:
Synopsis

(Advisory) Sections of code should not be "commented out" using C++ comments.

Enabled by default

No

Severity/Certainty

Low/Medium

lowmedium.png
Full description

Commented-out code has been detected. (To allow comments to contain pseudo-code or code samples, only comments that end in ';', '{', or '}' characters are considered to be commented-out code.) This check is identical to MISRAC++2023-5.7.2_b.

Coding standards
MISRA C++ 2023 5.7.2

(Advisory) Sections of code should not be “commented out”

Code examples

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

void example(void) {
	//int i;
}

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

void example(void) {
#if 0
	int i;
#endif
}