C++: Add a FP from DCA.

This commit is contained in:
Mathias Vorreiter Pedersen
2024-07-16 10:59:03 +01:00
parent 0fb27fb6fc
commit f5ec2315d7
2 changed files with 16 additions and 0 deletions

View File

@@ -14,3 +14,4 @@
| test.cpp:276:11:276:19 | ... > ... | Unsigned subtraction can never be negative. |
| test.cpp:288:10:288:18 | ... > ... | Unsigned subtraction can never be negative. |
| test.cpp:312:9:312:25 | ... > ... | Unsigned subtraction can never be negative. |
| test.cpp:335:6:335:18 | ... > ... | Unsigned subtraction can never be negative. |

View File

@@ -321,3 +321,18 @@ void test19() {
total += get_data();
}
}
void test20(int a, bool b, unsigned long c)
{
int x = 0;
if(b) {
x = (a - c) / 2;
} else {
x = a - c;
}
if (a - c - x > 0) // GOOD [FALSE POSITIVE]
{
}
}