Qt-Autosar-A16.2.1

The ‘, “, /*, //, characters shall not occur in a header file name or in #include directive

Required inputs: IR

Header file names in #include directives should contain only portable characters. Non-standard characters like quotes, backslashes, and comment markers can cause portability issues across different compilers and platforms, and may be misinterpreted by the preprocessor.
Bad code (non-standard characters in include):
#include "my'header.h"      // ERROR: single quote not portable
#include my_header.h        // ERROR: missing quotes/brackets
#include "folder\file.h"   // ERROR: backslash may not work on all platforms
#include "header/*name.h"   // ERROR: comment marker in name
Good code (portable include directives):
#include "my_header.h"      // OK: standard characters only
#include <iostream>        // OK: system include
#include "folder/file.h"    // OK: forward slash for paths
#include "config.h"         // OK: alphanumeric and underscore

Possible Messages

Key

Text

Severity

Disabled

nonstandard_include_character

Non-standard character in #include directive

None

False

Options

check_quotation_mark

check_quotation_mark : bool = True

Whether system includes should be checked for containing a ".
 

forbidden

forbidden : set[str] = {"'", '/*', '//', '\'}

The substrings to check for. " will be added for system-includes.