Skip to main content

IAR Embedded Workbench for RL78 5.20

MISRAC2012-Rule-18.5

In this section:
Synopsis

(Advisory) Declarations should contain no more than two levels of pointer nesting

Enabled by default

No

Severity/Certainty

Low/Medium

lowmedium.png
Full description

Declarations that contain more than two levels of pointer indirection have been found. This check is identical to MISRAC2004-17.5, MISRAC++2008-5-0-19, MISRAC++2023-11.3.2.

Coding standards
MISRA C:2004 17.5

(Required) The declaration of objects should contain no more than two levels of pointer indirection.

MISRA C++ 2008 5-0-19

(Required) The declaration of objects shall contain no more than two levels of pointer indirection.

MISRA C++ 2023 11.3.2

(Advisory) The declaration of an object should contain no more than two levels of pointer indirection

Code examples

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

void example(void) {
    int ***p;
}

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

void example(void) {
    int **p;
}