MISRA C:2012 Rule 5.1
External identifiers shall be distinct
Description
This checker is deactivated in a default Polyspace® as You Code analysis. See Checkers Deactivated in Polyspace as You Code Analysis (Polyspace Access).
Rule Definition
External identifiers shall be distinct.
Rationale
External identifiers are ones declared with global scope or
storage class extern
.
If the two long names are almost identical and differ only in the later part, they can be easily mistaken for each other. The readability of the code is reduced.
Polyspace Implementation
Polyspace considers two names as distinct if there is a difference between their
first 31 characters. For C90, the difference must occur between the first 6
characters. To use the C90 rules checking, use the value c90
for
the option C
standard version (-c-version)
. You can change the number of
characters compared using the option
-code-behavior-specifications
. See -code-behavior-specifications
.
Additional Message in Report
External %s %s
conflicts with the external
identifier XX in file YY.
Troubleshooting
If you expect a rule violation but do not see it, refer to Diagnose Why Coding Standard Violations Do Not Appear as Expected.
Examples
Check Information
Group: Identifiers |
Category: Required |
AGC Category: Required |
Version History
Introduced in R2014b