V2610. MISRA. The ', " or \ characters and the /* or // character sequences should not occur in a header file name.
This diagnostic rule is based on the MISRA (Motor Industry Software Reliability Association) manual for software development.
This rule only applies to C.
If you use certain characters in header file names, this can lead to undefined behavior. The rule prohibits using the following character sets:
- ', ", \, /*, // — in the name of any included file specified between '<' and '>';
- ', \, /*, // — in the name of any included file specified between double quotation marks.
#include <bad"include.h> #include "bad'include.h"
More often the diagnostic reveals the presence of a backslash in the path. MISRA sees this code as incorrect:
However, you can use a forward slash:
This diagnostic is classified as: