Skip to main content

IAR Embedded Workbench for Arm 9.70.x

MISRAC2012-Rule-1.5_c

In this section:
Synopsis

(Required) Obsolescent language features shall not be used.

Enabled by default

Yes

Severity/Certainty

Medium/Medium

mediummedium.png
Full description

The use of macro ATOMIC_VAR_INIT is an obsolescent feature.

Coding standards
MISRA C:2012 Rule-1.5

(Required) Obsolescent language features shall not be used.

Code examples

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

#include <stdatomic.h>

atomic_int af = ATOMIC_VAR_INIT(0);

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

#include <stdatomic.h>

atomic_int af = 0;