Skip to content

Commit 2095d1d

Browse files
Fix Preprocessor.json, for defined in if directive
1 parent 9830cc0 commit 2095d1d

File tree

2 files changed

+1
-41
lines changed

2 files changed

+1
-41
lines changed

cpp/misra/src/rules/RULE-19-1-1/DefinedOperatorExpandedInIfDirective.ql

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import codingstandards.cpp.misra
1919

2020
from PreprocessorIf ifDirective, MacroInvocation mi
2121
where
22-
not isExcluded(ifDirective, PreprocessorPackage::macroDefinitionContainsDefinedOperatorQuery()) and
22+
not isExcluded(ifDirective, PreprocessorPackage::definedOperatorExpandedInIfDirectiveQuery()) and
2323
ifDirective.getLocation().subsumes(mi.getLocation()) and
2424
mi.getMacro().getBody().regexpMatch(".*defined.*")
2525
select ifDirective,

rule_packages/cpp/Preprocessor.json

-40
Original file line numberDiff line numberDiff line change
@@ -98,46 +98,6 @@
9898
}
9999
],
100100
"title": "The #include directive shall be followed by either a <filename> or \"filename\" sequence"
101-
},
102-
"RULE-19-3-4": {
103-
"properties": {
104-
"enforcement": "decidable",
105-
"obligation": "required"
106-
},
107-
"queries": [
108-
{
109-
"description": "",
110-
"kind": "problem",
111-
"name": "Parentheses shall be used to ensure macro arguments are expanded appropriately",
112-
"precision": "very-high",
113-
"severity": "error",
114-
"short_name": "ParenthesesNotUsedToEnsureMacroArgumentsAreExpandedAppropriately",
115-
"tags": [
116-
"scope/single-translation-unit"
117-
]
118-
}
119-
],
120-
"title": "Parentheses shall be used to ensure macro arguments are expanded appropriately"
121-
},
122-
"RULE-19-6-1": {
123-
"properties": {
124-
"enforcement": "decidable",
125-
"obligation": "advisory"
126-
},
127-
"queries": [
128-
{
129-
"description": "",
130-
"kind": "problem",
131-
"name": "The #pragma directive and the _Pragma operator should not be used",
132-
"precision": "very-high",
133-
"severity": "error",
134-
"short_name": "PragmaDirectiveAndThePragmaOperatorShouldNotBeUsed",
135-
"tags": [
136-
"scope/single-translation-unit"
137-
]
138-
}
139-
],
140-
"title": "The #pragma directive and the _Pragma operator should not be used"
141101
}
142102
}
143103
}

0 commit comments

Comments
 (0)