[clang] Update Catch missing format attributes (PR #106649)

Budimir Aranđelović via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 30 00:54:04 PDT 2024


================
@@ -84,16 +81,16 @@ void f7(const char *out, ... /* args */) // #f7
 {
     va_list args;
 
-    vscanf(out, &args[0]); // expected-warning@#f7 {{diagnostic behavior may be improved by adding the 'scanf' format attribute to the declaration of 'f7'}}
-                           // CHECK: fix-it:"{{.*}}":{[[@LINE-5]]:6-[[@LINE-5]]:6}:"__attribute__((format(scanf, 1, 0)))"
+    vscanf(out, args); // expected-warning@#f7 {{diagnostic behavior may be improved by adding the 'scanf' format attribute to the declaration of 'f7'}}
+                       // CHECK: fix-it:"{{.*}}":{[[@LINE-5]]:6-[[@LINE-5]]:6}:"__attribute__((format(scanf, 1, 2)))"
 }
 
 void f8(const char *out, ... /* args */) // #f8
 {
     va_list args;
 
-    vscanf(out, &args[0]); // expected-no-warning@#f8
-    vprintf(out, &args[0]); // expected-no-warning@#f8
----------------
budimirarandjelovichtec wrote:

Seems that second argument is not passed properly.

https://github.com/llvm/llvm-project/pull/106649


More information about the cfe-commits mailing list