C and C++


LANG.PREPROC.INCL.FNAME : Dangerous Include File Name

Summary

The file name supplied to a #include or #include_next directive contains one of the following characters or character sequences.

Properties

Class Name Dangerous Include File Name
Significance style
Mnemonic LANG.PREPROC.INCL.FNAME
Categories
MisraC2023 MisraC2023:20.2 The ', " or \ characters and the /* or // character sequences shall not occur in a header file name
Misra2012 Misra2012:20.2 The ', " or \ characters and the /* or // character sequences shall not occur in a header file name
Misra2004 Misra2004:19.2 Non-standard characters should not occur in header file names in #include directives
AUTOSARC++14 AUTOSARC++14:A16-2-1 The ', ", /*, //, \ characters shall not occur in a header file name or in #include directive.
MisraC++2008 MisraC++2008:16-2-4 The ', ", /* or // characters shall not occur in a header file name.
  MisraC++2008:16-2-5 The \ character should not occur in a header file name.
MisraC++2023 MisraC++2023:19.2.3 The ', \ or " characters and the /* or // character sequences shall not occur in a header file name
JSF++ JSF++:53.1 The following character sequences shall not appear in header file names: ', \, /*, //, or ".
DISA-3r10 DISA-3r10:V-6157 The designer will ensure the application does not contain invalid URL or path references.
Availability Available for C and C++.
Enabling Checks for this warning class are disabled by default. To enable them, add the following WARNING_FILTER rule to the project configuration file.
WARNING_FILTER += allow class="Dangerous Include File Name"

Example

#include "LANG.PREPROC.INCL.FNAME.h"                       /* no illegal characters ("" are delimiters, not part of file name) */
#include "LANG.PREPROC.INCL.FNAME'.h"  /* 'Dangerous Include File Name' warning issued here */

Relevant Configuration File Parameters

The following configuration file parameters affect checks for this warning class.