Merge pull request #18200 from github/calumgrant/bmn/wrong-type-format-args2

C++: Fix more FPs with extraction errors on cpp/wrong-type-format-arguments
This commit is contained in:
Calum Grant
2024-12-06 17:50:56 +00:00
committed by GitHub
3 changed files with 7 additions and 2 deletions

View File

@@ -3,9 +3,10 @@
int printf(const char * format, ...);
int fprintf();
void f() {
void f(UNKNOWN_CHAR * str) {
printf("%s", 1); // BAD
printf("%s", implicit_function()); // GOOD - we should ignore the type
sprintf(0, "%s", ""); // GOOD
fprintf(0, "%s", ""); // GOOD
printf("%s", str); // GOOD - erroneous type is ignored
}