MISRAC++2008-5-0-19
In this section:
Synopsis
(Required) The declaration of objects shall contain no more than two levels of pointer indirection.
Enabled by default
Yes
Severity/Certainty
Low/Medium

Full description
Declarations that contain more than two levels of pointer indirection have been found. This check is identical to MISRAC2004-17.5, MISRAC2012-Rule-18.5, 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:2012 Rule-18.5
(Advisory) Declarations should contain no more than two levels of pointer nesting
- 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;
}