Skip to content
Open
Prev Previous commit
Next Next commit
Fix Preprocessor.json, for defined in if directive
  • Loading branch information
MichaelRFairhurst committed Apr 29, 2025
commit 2095d1d2dbf9608c2e6d4117029292bbbb63515f
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import codingstandards.cpp.misra

from PreprocessorIf ifDirective, MacroInvocation mi
where
not isExcluded(ifDirective, PreprocessorPackage::macroDefinitionContainsDefinedOperatorQuery()) and
not isExcluded(ifDirective, PreprocessorPackage::definedOperatorExpandedInIfDirectiveQuery()) and
ifDirective.getLocation().subsumes(mi.getLocation()) and
mi.getMacro().getBody().regexpMatch(".*defined.*")
select ifDirective,
Expand Down
40 changes: 0 additions & 40 deletions rule_packages/cpp/Preprocessor.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,46 +98,6 @@
}
],
"title": "The #include directive shall be followed by either a <filename> or \"filename\" sequence"
},
"RULE-19-3-4": {
"properties": {
"enforcement": "decidable",
"obligation": "required"
},
"queries": [
{
"description": "",
"kind": "problem",
"name": "Parentheses shall be used to ensure macro arguments are expanded appropriately",
"precision": "very-high",
"severity": "error",
"short_name": "ParenthesesNotUsedToEnsureMacroArgumentsAreExpandedAppropriately",
"tags": [
"scope/single-translation-unit"
]
}
],
"title": "Parentheses shall be used to ensure macro arguments are expanded appropriately"
},
"RULE-19-6-1": {
"properties": {
"enforcement": "decidable",
"obligation": "advisory"
},
"queries": [
{
"description": "",
"kind": "problem",
"name": "The #pragma directive and the _Pragma operator should not be used",
"precision": "very-high",
"severity": "error",
"short_name": "PragmaDirectiveAndThePragmaOperatorShouldNotBeUsed",
"tags": [
"scope/single-translation-unit"
]
}
],
"title": "The #pragma directive and the _Pragma operator should not be used"
}
}
}
Loading