Skip to content

Update MISRA queries and tests after merging location tables #915

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion c/misra/test/rules/RULE-2-4/UnusedTagDeclaration.expected
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
| test.c:17:6:17:7 | E1 | struct E1 has an unused tag. |
| test.c:31:10:31:11 | S7 | struct S7 has an unused tag. |
| test.c:50:8:50:10 | S10 | struct S10 has an unused tag. |
| test.c:66:3:66:14 | S13 | struct S13 has an unused tag. |
| test.c:79:8:79:10 | s14 | struct s14 has an unused tag. |
6 changes: 3 additions & 3 deletions c/misra/test/rules/RULE-2-4/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ struct S12 { // COMPLIANT
};

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

void testMacroNameNotUsed() {
Expand Down
3 changes: 2 additions & 1 deletion cpp/common/src/codingstandards/cpp/Loops.qll
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ predicate isInvalidLoop(ForStmt forLoop, string reason, Locatable reasonLocation
isForLoopWithMulipleCounters(forLoop) and
reason = "it uses multiple loop counters$@" and
reasonLabel = "" and
reasonLocation.getLocation() instanceof UnknownExprLocation
reasonLocation instanceof File and
reasonLocation.getLocation() instanceof UnknownLocation
or
isForLoopWithFloatingPointCounters(forLoop, reasonLocation) and
reason = "it uses a loop counter '$@' of type floating-point" and
Expand Down
Loading