Why is this an issue?
The #include
directive allows you to include header files in your code by enclosing the file names in either double quotes
("
) or angle brackets (<
and >
). However, using:
-
'
, \
or /*
characters between the double quotes (for example: #include "dir\foo.h"
)
-
'
, \
, "
or /*
characters between the angle brackets (for example: #include
<"foo">
)
in the header names may or may not be supported, and the behavior will depend on the specific implementation.
Resources
- MISRA C:2004, 19.2 - Non-standard characters should not occur in header file names in #include directives.
- MISRA C++:2008, 16-2-4 - The ', ", /* or // characters shall not occur in a header file name.
- MISRA C++:2008, 16-2-5 - The \ character should not occur in a header file name.
- MISRA C:2012, 20.2 - The ', " or \ characters and the /* or // character sequences shall not occur in a header file name