MISRA C:2023 Rule 5.8
Identifiers that define objects or functions with external linkage shall be unique
Since R2024a
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 external linkage shall be unique1 .
Rationale
External identifiers are those declared with global scope or
with storage class extern
. Reusing an external
identifier name can cause developer confusion.
Identifiers defined within a function have smaller scope. Even if names of such identifiers are not unique, they are not likely to cause confusion.
Troubleshooting
If you expect a rule violation but do not see it, refer to Diagnose Why Coding Standard Violations Do Not Appear as Expected.
Check Information
Group: Identifiers |
Category: Required |
AGC Category: Required |
Version History
Introduced in R2024a
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.