AutosarC++18_03-M16.2.3¶
Include guards shall be provided
Required inputs: IR
Include guards also help reduce compilation time, as compilers that recognize the include guard can avoid repeatedly scanning the header file.
Example
#ifndef DIR_FILE_H #define DIR_FILE_H ... #endif
The identifiers used for include guards must be unique. If header file names are not necessarily unique in your project, include the directory name in the identifier.
Note
For legal reasons, this rule’s description is not part of the public documentation.