Skip to main content

IAR Embedded Workbench for RISC-V 3.40

MISRAC2004-2.2

In this section:
Synopsis

(Required) Source code shall only use /* ... */ style comments.

Enabled by default

Yes

Severity/Certainty

Low/High

lowhigh.png
Full description

Uses of // comments were found.

Coding standards
MISRA C:2004 2.2

(Required) Source code shall only use /* ... */ style comments.

Code examples

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

void example(void) {
	// an end of line comment
}

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

void example(void) {
	/* a terminated comment */
}