-
Type:
Finding Detection
-
Status: Closed
-
Resolution: Fixed
-
Labels:None
-
Default Severity:Major
-
Impact:Low
-
Likelihood:High
-
Legacy Key:PPIncludeBackslash
-
Remediation Function:Constant/Issue
-
Constant Cost:5min
It is undefined behavior if the '\' character is used between < and > delimiters or between the " delimiters in a header name preprocessing token.
Note that this rule is only advisory, since some environments use '\' as a file name delimiter. However, compilers for those environments often support the use of '/' in #include directives.
Noncompliant Code Example
#include "foo\bar.h" /* Noncompliant */
Compliant Solution
#include "foo/bar.h" /* Compliant */
See
- MISRA C++:2008, 16-2-5 - The \ character should not occur in a header file name.