mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
C++: Fix false positives
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
void func_with_default_arg(const int n = 0) {
|
||||
if(n <= 10) {} // GOOD [FALSE POSITIVE]
|
||||
if(n <= 10) {}
|
||||
}
|
||||
|
||||
struct A {
|
||||
@@ -13,7 +13,7 @@ struct A {
|
||||
|
||||
struct B {
|
||||
B(const int n = 0) {
|
||||
if(n <= 10) {} // GOOD [FALSE POSITIVE]
|
||||
if(n <= 10) {}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -25,5 +25,5 @@ void test1() {
|
||||
A a(100);
|
||||
if(a.int_member <= 10) {}
|
||||
|
||||
if(volatile_const_global <= 10) {} // GOOD [FALSE POSITIVE]
|
||||
if(volatile_const_global <= 10) {}
|
||||
}
|
||||
@@ -38,8 +38,5 @@
|
||||
| PointlessComparison.c:303:9:303:14 | ... >= ... | Comparison is always false because c <= 0. |
|
||||
| PointlessComparison.c:312:9:312:14 | ... >= ... | Comparison is always false because c <= 0. |
|
||||
| PointlessComparison.c:337:14:337:21 | ... >= ... | Comparison is always true because x >= 0. |
|
||||
| PointlessComparison.cpp:2:8:2:14 | ... <= ... | Comparison is always true because n <= 0. |
|
||||
| PointlessComparison.cpp:16:12:16:18 | ... <= ... | Comparison is always true because n <= 0. |
|
||||
| PointlessComparison.cpp:28:8:28:34 | ... <= ... | Comparison is always true because volatile_const_global <= 0. |
|
||||
| RegressionTests.cpp:57:7:57:22 | ... <= ... | Comparison is always true because * ... <= 4294967295. |
|
||||
| Templates.cpp:9:10:9:24 | ... <= ... | Comparison is always true because local <= 32767. |
|
||||
|
||||
Reference in New Issue
Block a user