Skip to main content

IAR Embedded Workbench for RL78 5.20

MISRAC2012-Rule-9.3

In this section:
Synopsis

(Required) Arrays shall not be partially initialized.

Enabled by default

Yes

Severity/Certainty

Medium/Medium

mediummedium.png
Full description

Arrays were found that are partially initialized.

Coding standards
MISRA C:2012 Rule-9.3

(Required) Arrays shall not be partially initialized

Code examples

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

void example(void) {
	int y[3][3] = { { 1, 2, 3 }, { 4, 5, 6 } };
}

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

void example(void) {
	int y[3][2] = { { 1, 2 }, { 3, 4 }, { 5, 6 } };
}