AutosarC++18_03-M16.0.1¶
#include directives in a file shall only be preceded by other preprocessor directives or comments
Required inputs: IR
| Level | required |
|---|---|
| Target | implementation |
| Enforcement | automated |
Rationale
To aid code readability, all the #include directives in a particular code file should be grouped together near the head of the file. The only items which may precede a #include in a file are other preprocessor directives or comments.
Example
#include <f1.h> // Compliant
int32_t i;
#include <f2.h> // Non-compliant
Note
For legal reasons, this rule’s description is not part of the public documentation.