MISRA C:2025 Rule 20.2
R2026bThe ', " or \ characters and the /* or // character sequences shall not occur in a header file name
Since R2026b
Description
The ', " or \ characters and the /* or // character sequences shall not occur in a header file name 1 .
Rationale
The program's behavior is undefined if:
You use
',",\,/*or//between< >delimiters in a header name preprocessing token.You use
',\,/*or//between"delimiters in a header name preprocessing token.
Although \ results in undefined
behavior, many implementations accept / in its
place.
Polyspace Implementation
Polyspace® flags the characters ', ", \, /* or // between < and > in #include
<filename>.
Polyspace flags the characters ', \, /* or // between " and " in #include
"filename".
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: Preprocessing Directives |
| Category: Required |
| AGC Category: Required |
PQL Name:
std.misra_c_2025.R20_2
|
Version History
Introduced in R2026b
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:2025
MISRA C++:2008
MISRA C++:2023
MISRA and MISRA C are registered trademarks of The MISRA Consortium Limited 2021.