MISRA.INCL.SYMSNon-standard characters in header file names.
MISRA C 2012 Rule 20.2: The ', " or \ characters and the /* or // character sequences shall not occur in a header file nameC90 [Undefined 14], C99 [Undefined 31] Category: Required Analysis: Decidable, Single Translation Unit Applies to: C90, C99 RationaleThe behaviour is undefined if:
Example#include "fi'le.h" /* Non-compliant */ MISRA-C 2004 Rule 19.2 (advisory): Non-standard characters should not occur in header file names in #include directives.Non-standard characters in header file names. [Undefined 14] If the ', \, ", or /* characters are used between < and > delimiters or the ', \, or /* characters are used between the " delimiters in a header name preprocessing token, then the behaviour is undefined. Use of the \ character is permitted in filename paths without the need for a deviation if required by the host operating system of the development environment. MISRA-C++ 2008 Rule 16-2-4 (required): The ', ", /* or // characters shall not occur in a header file name.[Undefined 2.8(2)] RationaleIt is undefined behaviour if the ', ", /* or // characters are used between < and > delimiters or the ', /* or // characters are used between the " delimiters in a header name preprocessing token. Example#include "fi'le.h" // Non-compliant MISRA-C++ Rule 16-2-5 (advisory): The \ character should not occur in a header file name.[Undefined 2.8(2)] RationaleIt is undefined behaviour 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. Compilers for these environments often support the use of / in #include directives. Example#include "fi\\le.h" // Non-compliant |