Skip to main content

IAR Embedded Workbench for RISC-V 3.40

CERT-MSC40-C_c

In this section:
Synopsis

Do not violate constraints.

Enabled by default

Yes

Severity/Certainty

Medium/Medium

mediummedium.png
Full description

The C Standard, 6.7.2.3, paragraph 2 outlines the following constraint: a type specifier of the form `enum identifier` without an enumerator list shall only appear after the type it specifies is complete.

Coding standards
CERT MSC40-C

Do not violate constraints

Code examples

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

enum E e;

enum E {E1, E2};

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

enum E {E1, E2};

enum E e;