You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[clang][Sema] Accept gnu format attributes (#160255)
This patch teaches clang accepts gnu_printf, gnu_scanf, gnu_strftime and
gnu_strfmon. These attributes are aliases for printf, scanf, strftime and
strfmon.
Ref: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.htmlFixes: #16219
---------
Co-authored-by: Sirraide <aeternalmail@gmail.com>
voidc2(constchar*a, ...) __attribute__((format(syslog, 0, 2))); // expected-error {{'format' attribute parameter 2 is out of bounds}}
107
107
voidd2(constchar*a, intc) __attribute__((format(syslog, 1, 2))); // expected-warning {{GCC requires a function with the 'format' attribute to be variadic}}
108
108
voide2(char*str, intc, ...) __attribute__((format(syslog, 2, 3))); // expected-error {{format argument not a string type}}
voidb2(constchar*a, ...) __attribute__((format(gnu_printf, 1, 1))); // expected-error {{'format' attribute parameter 3 is out of bounds}}
114
+
voidc2(constchar*a, ...) __attribute__((format(gnu_printf, 0, 2))); // expected-error {{'format' attribute parameter 2 is out of bounds}}
115
+
voidd2(constchar*a, intc) __attribute__((format(gnu_printf, 1, 2))); // expected-warning {{GCC requires a function with the 'format' attribute to be variadic}}
116
+
voide2(char*str, intc, ...) __attribute__((format(gnu_printf, 2, 3))); // expected-error {{format argument not a string type}}
0 commit comments