C and C++


LANG.STRUCT.TMID : Too Much Indirection in Declaration

Summary

The amount of indirection in a declaration exceeds the limit specified by MAX_PERMITTED_INDIRECTION_IN_DECLARATION.

Properties

Class Name Too Much Indirection in Declaration
Significance style
Mnemonic LANG.STRUCT.TMID
Categories
MisraC2023 MisraC2023:18.5 Declarations should contain no more than two levels of pointer nesting
Misra2012 Misra2012:18.5 Declarations should contain no more than two levels of pointer nesting
AUTOSARC++14 AUTOSARC++14:A5-0-3 The declaration of objects shall contain no more than two levels of pointer indirection.
MisraC++2008 MisraC++2008:5-0-19 The declaration of objects shall contain no more than two levels of pointer indirection.
MisraC++2023 MisraC++2023:11.3.2 The declaration of objects should contain no more than two levels of pointer indirection
CWE CWE:710 Improper Adherence to Coding Standards
JSF++ JSF++:169 Pointers to pointers should be avoided when possible.
  JSF++:170 More than 2 levels of pointer indirection shall not be used.
JPL JPL:26 Use no more than two levels of indirection per declaration.
Availability Available for C and C++.
Enabling Checks for this warning class are disabled by default, and require the unnormalized C ASTs for the project. To enable them, add the following WARNING_FILTER rule and RETAIN_UNNORMALIZED_C_AST specification to the project configuration file.
RETAIN_UNNORMALIZED_C_AST = Yes
WARNING_FILTER += allow class="Too Much Indirection in Declaration"
Note that retaining the unnormalized ASTs will increase the disk space used to store the project representation, and may make the analysis take longer.

Example

char ***ppzstrings; /* 'Too Much Indirection in Declaration' warning issued here */

Relevant Configuration File Parameters

The following configuration file parameters affect checks for this warning class.