Revert "Merge pull request #17938 from MathiasVP/fix-fp-in-missing-check-scanf-fixing-take-2"

This reverts commit 6785b93ed8, reversing
changes made to d9b86f55c8.
This commit is contained in:
Jeroen Ketema
2024-11-21 15:39:00 +01:00
parent aa4cc72f30
commit fa8aba88af
9 changed files with 125 additions and 755 deletions

View File

@@ -553,27 +553,3 @@ void switch_cases(const char *data) {
break;
}
}
void test_scanf_compared_right_away() {
int i;
bool success = scanf("%d", &i) == 1;
if(success) {
use(i); // GOOD
}
}
void test_scanf_compared_in_conjunct_right(bool b) {
int i;
bool success = b && scanf("%d", &i) == 1;
if(success) {
use(i); // GOOD [FALSE POSITIVE]
}
}
void test_scanf_compared_in_conjunct_left(bool b) {
int i;
bool success = scanf("%d", &i) == 1 && b;
if(success) {
use(i); // GOOD [FALSE POSITIVE]
}
}