Main Content

MISRA C:2012 Rule 5.8

Identifiers that define objects or functions with external linkage shall 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 external linkage shall be unique.

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.

Additional Message in Report

  • Object XX conflicts with the object name YY.

  • Function XX conflicts with the function name 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.

Check Information

Group: Identifiers
Category: Required
AGC Category: Required

Version History

Introduced in R2014b