Skip to content

Commit 3bfd34e

Browse files
committed
Merge branch 'for-6.15-printf-attribute' into for-linus
2 parents af54a3a + b5960a0 commit 3bfd34e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

include/linux/compiler-gcc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@
127127
#define __diag_GCC_8(s)
128128
#endif
129129

130+
#define __diag_GCC_all(s) __diag(s)
131+
130132
#define __diag_ignore_all(option, comment) \
131133
__diag(__diag_GCC_ignore option)
132134

lib/vsprintf.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,10 +1699,9 @@ char *escaped_string(char *buf, char *end, u8 *addr, struct printf_spec spec,
16991699
return buf;
17001700
}
17011701

1702-
#pragma GCC diagnostic push
1703-
#ifndef __clang__
1704-
#pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
1705-
#endif
1702+
__diag_push();
1703+
__diag_ignore(GCC, all, "-Wsuggest-attribute=format",
1704+
"Not a valid __printf() conversion candidate.");
17061705
static char *va_format(char *buf, char *end, struct va_format *va_fmt,
17071706
struct printf_spec spec)
17081707
{
@@ -1717,7 +1716,7 @@ static char *va_format(char *buf, char *end, struct va_format *va_fmt,
17171716

17181717
return buf;
17191718
}
1720-
#pragma GCC diagnostic pop
1719+
__diag_pop();
17211720

17221721
static noinline_for_stack
17231722
char *uuid_string(char *buf, char *end, const u8 *addr,

0 commit comments

Comments
 (0)