AutosarC++18_03-A16.0.1¶
The pre-processor shall only be used for unconditional and conditional file inclusion and include guards, and using the following directives: (1) #ifndef, (2) #ifdef, (3) #if, (4) #if defined, (5) #elif, (6) #else, (7) #define, (8) #endif, (9) #include
Required inputs: IR
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
function_macro_definition |
Macros are only allowed for include guards |
None |
False |
line_directive |
The pre-processor shall only be used for file inclusion and include guards. |
None |
False |
object_macro_definition |
Macros are only allowed for include guards |
None |
False |
pp_if |
Conditional compilation is only allowed for include guards |
None |
False |
pragma |
The pre-processor shall only be used for file inclusion and include guards. |
None |
False |
undef |
The pre-processor shall only be used for file inclusion and include guards. |
None |
False |
Options¶
This rule shares the following common options: exclude_in_macros, exclude_messages_in_system_headers, excludes, extend_exclude_to_macro_invocations, includes, justification_checker, languages, post_processing, provider, report_at, severity
The following places define options that affect this rule: Stylechecks, Analysis-GlobalOptions
accept_conditional_includes¶
accept_conditional_includes : bool = True
#ifs for conditional includes.
allowed_pragmas¶
allowed_pragmas : set[str] = set()
exception_strings¶
exception_strings : list[str] = []
report_elif¶
report_elif : bool = True
#elif in addition to the initial
#if/#ifdef.