Skip to main content

IAR Embedded Workbench for RX 5.20

MISRAC2012-Rule-17.6

In this section:
Synopsis

(Mandatory) The declaration of an array parameter shall not contain the static keyword between the [ ]

Enabled by default

Yes

Severity/Certainty

Medium/Medium

mediummedium.png
Full description

There are array parameters with the static keyword between the [].

Coding standards
MISRA C:2012 Rule-17.6

(Mandatory) The declaration of an array parameter shall not contain the static keyword between the [ ]

Code examples

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

void example(int a[static 20]) {
  for (int i = 0; i < 10; i++) {
    a[i] = i;
  }
}

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

void example(int a[20]) {
  for (int i = 0; i < 10; i++) {
    a[i] = i;
  }
}