MISRA C:2023 Rule 5.5
Description
Rule Definition
Identifiers shall be distinct from macro names.
Rationale
The rule requires that macro names that exist only prior to processing must be different from identifier names that also exist after preprocessing. Keeping macro names and identifiers distinct help avoid confusion.
Polyspace Implementation
Polyspace® considers two names as distinct if there is a difference between their
first 63 characters. In C90, the difference must occur between the first 31
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
.
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 R2024a