MISRA C++:2023 Rule 5.10.1
Description
Rule Definition
User-defined identifiers shall have an appropriate form.
Rationale
This rule restricts the names that can be given to user-identifier identifiers.
The restrictions reduce possible ambiguity and improve the portability of your code by:
Supporting only Unicode-recommended characters in identifier names.
Preventing collisions with reserved names.
Allowing clear distinction between identifiers and macros.
Enforcing some commonly-accepted coding styles.
Polyspace Implementation
Following the MISRA™: C++: 2023 specifications, the rule checker reports a violation if an identifier uses a forbidden name, as defined below.
Type of Identifier | Forbidden Names |
---|---|
All types, except macros. |
|
Macros | Names that contain a character outside |
Namespaces | The names |
User-defined literal suffix | Names that do not start with |
Troubleshooting
If you expect a rule violation but Polyspace® does not report it, see Diagnose Why Coding Standard Violations Do Not Appear as Expected.
Examples
Check Information
Group: Lexical Conventions |
Category: Required |
Version History
Introduced in R2024b