Main Content
MISRA C:2023 Rule 17.6
The declaration of an array parameter shall not contain the static keyword between the [ ]
Since R2024a
Description
Rule Definition
The declaration of an array parameter shall not contain the static keyword between the [ ].
Rationale
If you use the static
keyword within []
for
an array parameter of a function, you can inform a C99 compiler that
the array contains a minimum number of elements. The compiler can
use this information to generate efficient code for certain processors.
However, in your function call, if you provide less than the specified
minimum number, the behavior is not defined.
Troubleshooting
If you expect a rule violation but do not see it, refer to Diagnose Why Coding Standard Violations Do Not Appear as Expected.
Examples
Check Information
Group: Function |
Category: Mandatory |
AGC Category: Mandatory |
Version History
Introduced in R2024a