MISRA C++:2008 Rule 3-9-1
The types used for an object, a function return type, or a function parameter shall be token-for-token identical in all declarations and re-declarations
Description
Rule Definition
The types used for an object, a function return type, or a function parameter shall be token-for-token identical in all declarations and re-declarations.
Rationale
If a redeclaration is not token-for-token identical to the previous declaration, it is not clear from visual inspection which object or function is being redeclared.
Polyspace Implementation
The rule checker compares the current declaration with the last seen declaration.
Additional Message in Report
The types used for an object, a function return type, or a function parameter shall be token-for-token identical in all declarations and re-declarations.
Variable varName
is not compatible with previous
declaration.
Troubleshooting
If you expect a rule violation but Polyspace® does not report it, see Diagnose Why Coding Standard Violations Do Not Appear as Expected.
Examples
Check Information
Group: Basic Concepts |
Category: Required |
Version History
Introduced in R2013b