MISRA C:2012 Rule 5.9
Identifiers that define objects or functions with internal linkage should be unique
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
Identifiers that define objects or functions with internal linkage should be unique1 .
Rationale
Identifiers that have internal linkage are accessible only in the translation unit
where they are declared. These identifiers are typically declared as
static
. If such identifiers are nonunique, the code might
become difficult to understand and lead to unexpected results.
Polyspace Implementation
Polyspace flags the static
variable names that are nonunique
across all translation units.
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: Advisory |
AGC Category: Readability |
Version History
Introduced in R2014b
See Also
1 All MISRA coding rules and directives are © Copyright The MISRA Consortium Limited 2021.
The MISRA coding standards referenced in the Polyspace Bug Finder™ documentation are from the following MISRA standards:
MISRA C:2004
MISRA C:2012
MISRA C:2023
MISRA C++:2008
MISRA C++:2023
MISRA and MISRA C are registered trademarks of The MISRA Consortium Limited 2021.