CPP: Fix query.

This commit is contained in:
Geoffrey White
2019-07-17 11:42:17 +01:00
parent aa368d8763
commit 48a60651b6
3 changed files with 5 additions and 5 deletions

View File

@@ -2,4 +2,4 @@
| bsc.cpp:6:10:6:32 | ... > ... | Potential unsafe sign check of a bitwise operation. |
| bsc.cpp:10:10:10:33 | ... >= ... | Potential unsafe sign check of a bitwise operation. |
| bsc.cpp:18:10:18:28 | ... > ... | Potential unsafe sign check of a bitwise operation. |
| bsc.cpp:30:10:30:20 | ... < ... | Potential unsafe sign check of a bitwise operation. |
| bsc.cpp:22:10:22:28 | ... < ... | Potential unsafe sign check of a bitwise operation. |

View File

@@ -19,7 +19,7 @@ bool is_bit31_set_bad_v1(int x) {
}
bool is_bit31_set_bad_v2(int x) {
return 0 < (x & (1 << 31)); // BAD [NOT DETECTED]
return 0 < (x & (1 << 31)); // BAD
}
bool is_bit31_set_good(int x) {
@@ -27,5 +27,5 @@ bool is_bit31_set_good(int x) {
}
bool deliberately_checking_sign(int x, int y) {
return (x & y) < 0; // GOOD (use of `<` implies the sign check is intended) [FALSE POSITIVE]
return (x & y) < 0; // GOOD (use of `<` implies the sign check is intended)
}