Qt-Generic-MissingIncludeGuard¶
Include files need an include guard
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.
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
include_guard_missing |
Missing include guard. |
None |
False |
include_guard_partial |
Include guard does not cover complete file. |
None |
False |
include_guard_with_wrong_define |
Bad include guard: #define uses wrong macro, should be {}. |
None |
False |
include_guard_without_define |
Incomplete include guard: missing #define {}. |
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
macro_name_restrictions¶
macro_name_restrictions : list[typing.Callable[[bauhaus.ir.Node, scanner.Token, typing.Optional[str]], typing.Optional[str]]] = []