Skip to content

Commit f07f569

Browse files
committed
Update MISRA queries and tests after merging location tables
1 parent d6b55ca commit f07f569

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

c/misra/test/rules/RULE-2-4/UnusedTagDeclaration.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
| test.c:17:6:17:7 | E1 | struct E1 has an unused tag. |
44
| test.c:31:10:31:11 | S7 | struct S7 has an unused tag. |
55
| test.c:50:8:50:10 | S10 | struct S10 has an unused tag. |
6-
| test.c:66:3:66:14 | S13 | struct S13 has an unused tag. |
76
| test.c:79:8:79:10 | s14 | struct s14 has an unused tag. |

c/misra/test/rules/RULE-2-4/test.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ struct S12 { // COMPLIANT
6363
};
6464

6565
void testMacroNameUsed() {
66-
STRUCT_MACRO // COMPLIANT[FALSE_POSITIVE] - although the struct generated by
67-
// the macro is never used in this expansion, it may be used in
68-
// other expansions, so we don't want to report it as unused
66+
STRUCT_MACRO // COMPLIANT - although the struct generated by the macro is
67+
// never used in this expansion, it may be used in other
68+
// expansions, so we don't want to report it as unused
6969
}
7070

7171
void testMacroNameNotUsed() {

cpp/common/src/codingstandards/cpp/Loops.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@ predicate isInvalidLoop(ForStmt forLoop, string reason, Locatable reasonLocation
339339
isForLoopWithMulipleCounters(forLoop) and
340340
reason = "it uses multiple loop counters$@" and
341341
reasonLabel = "" and
342-
reasonLocation.getLocation() instanceof UnknownExprLocation
342+
reasonLocation instanceof File and
343+
reasonLocation.getLocation() instanceof UnknownLocation
343344
or
344345
isForLoopWithFloatingPointCounters(forLoop, reasonLocation) and
345346
reason = "it uses a loop counter '$@' of type floating-point" and

0 commit comments

Comments
 (0)