-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathUndefinedMacroIdentifiersUsedIn.ql
More file actions
26 lines (24 loc) · 1.13 KB
/
UndefinedMacroIdentifiersUsedIn.ql
File metadata and controls
26 lines (24 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/**
* @id cpp/autosar/undefined-macro-identifiers-used-in
* @name M16-0-7: Undefined macro identifiers shall not be used in #if or #elif pre-processor directives, except as operands to the defined operator
* @description Using undefined macro identifiers in #if or #elif pre-processor directives, except
* as operands to the defined operator, can cause the code to be hard to understand
* because the preprocessor will just treat the value as 0 and no warning is given.
* @kind problem
* @precision high
* @problem.severity warning
* @tags external/autosar/id/m16-0-7
* correctness
* readability
* external/autosar/allocated-target/implementation
* external/autosar/enforcement/automated
* external/autosar/obligation/required
*/
import cpp
import codingstandards.cpp.autosar
import codingstandards.cpp.rules.undefinedmacroidentifiers.UndefinedMacroIdentifiers
class UndefinedMacroIdentifiersUsedInQuery extends UndefinedMacroIdentifiersSharedQuery {
UndefinedMacroIdentifiersUsedInQuery() {
this = MacrosPackage::charactersOccurInHeaderFileNameOrInIncludeDirectiveQuery()
}
}