[clang] [clang][Sema] Accept gnu format attributes (PR #160255)

via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 23 01:16:32 PDT 2025


================
@@ -106,3 +106,11 @@ void b2(const char *a, ...) __attribute__((format(syslog, 1, 1)));    // expecte
 void c2(const char *a, ...) __attribute__((format(syslog, 0, 2)));    // expected-error {{'format' attribute parameter 2 is out of bounds}}
 void d2(const char *a, int c) __attribute__((format(syslog, 1, 2)));  // expected-warning {{GCC requires a function with the 'format' attribute to be variadic}}
 void e2(char *str, int c, ...) __attribute__((format(syslog, 2, 3))); // expected-error {{format argument not a string type}}
+
+// gnu_printf
+// same as format(pritf(...))...
----------------
Sirraide wrote:

```suggestion
// same as format(printf(...))...
```

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


More information about the cfe-commits mailing list