Skip to content

Commit

Permalink
add sample
Browse files Browse the repository at this point in the history
  • Loading branch information
danmar committed Oct 6, 2024
1 parent 4dbd1db commit c3bb804
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/CI-unixish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ jobs:
fi
# test sarif output
./cppcheck --enable=style --error-exitcode=0 --platform=unix64 --inconclusive samples/unreadVariable --output-file=samples.sarif --output-format=sarif
./cppcheck --enable=style --error-exitcode=0 --platform=unix64 --inconclusive samples/incorrectLogicOperator/bad.c --output-file=samples.sarif --output-format=sarif
cat samples.sarif
# self check simplecpp
Expand Down
4 changes: 4 additions & 0 deletions samples/incorrectLogicOperator/bad.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

void foo(int x) {
if (x >= 0 || x <= 10) {}
}
3 changes: 3 additions & 0 deletions samples/incorrectLogicOperator/out.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
samples/incorrectLogicOperator/bad.c:3:16: warning: Logical disjunction always evaluates to true: x >= 0 || x <= 10. [incorrectLogicOperator]
if (x >= 0 || x <= 10) {}
^

0 comments on commit c3bb804

Please sign in to comment.