Skip to main content

IAR Embedded Workbench for Arm 9.70.x

MISRAC++2023-11.3.1 (C++ only)

In this section:
Synopsis

(Advisory) Variables of array type should not be declared

Enabled by default

No

Severity/Certainty

Low/High

lowhigh.png
Full description

Variables of array type does not have value semantics and need to have their size managed manually.

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:

void example() {
  int a[ 32 ]; // Non-compliant
}

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

#include <array>

void example() {
  std::array< int, 32 > a; // Compliant
}