Skip to content

Commit feb21ce

Browse files
committed
Fix RULE-4-10 -> DIR-4-10
1 parent 97f6657 commit feb21ce

File tree

5 files changed

+27
-3
lines changed

5 files changed

+27
-3
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* @id c/misra/precaution-include-guards-not-provided
3+
* @name DIR-4-10: Precautions shall be taken in order to prevent the contents of a header file being included more than once
4+
* @description Using anything other than a standard include guard form can make code confusing and
5+
* can lead to multiple or conflicting definitions.
6+
* @kind problem
7+
* @precision very-high
8+
* @problem.severity warning
9+
* @tags external/misra/id/dir-4-10
10+
* correctness
11+
* maintainability
12+
* readability
13+
* external/misra/obligation/required
14+
*/
15+
16+
import cpp
17+
import codingstandards.c.misra
18+
import codingstandards.cpp.rules.includeguardsnotused.IncludeGuardsNotUsed
19+
20+
class PrecautionIncludeGuardsNotProvidedQuery extends IncludeGuardsNotUsedSharedQuery {
21+
PrecautionIncludeGuardsNotProvidedQuery() {
22+
this = Preprocessor2Package::precautionIncludeGuardsNotProvidedQuery()
23+
}
24+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
c/common/test/rules/includeguardsnotused/IncludeGuardsNotUsed.ql

c/misra/test/rules/RULE-4-10/NonUniqueIncludeGuards.testref

Lines changed: 0 additions & 1 deletion
This file was deleted.

cpp/common/src/codingstandards/cpp/exclusions/c/Preprocessor2.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ predicate isPreprocessor2QueryMetadata(Query query, string queryId, string ruleI
4040
queryId =
4141
// `@id` for the `precautionIncludeGuardsNotProvided` query
4242
"c/misra/precaution-include-guards-not-provided" and
43-
ruleId = "RULE-4-10"
43+
ruleId = "DIR-4-10"
4444
}
4545

4646
module Preprocessor2Package {

rule_packages/c/Preprocessor2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
],
6464
"title": "#undef should not be used"
6565
},
66-
"RULE-4-10": {
66+
"DIR-4-10": {
6767
"properties": {
6868
"obligation": "required"
6969
},

0 commit comments

Comments
 (0)