Skip to content

Commit 7efa84b

Browse files
nathanchancepmladek
authored andcommitted
compiler-gcc.h: Introduce __diag_GCC_all
It is not possible disabling a diagnostic for all versions of GCC without hard coding the minimum supported version at the site, as the GCC specific macros require a minimum version to disable the warning for: __diag_ignore(GCC, 5, ...); __diag_ignore_all() does not solve this issue because it disables a diagnostic for all versions of both GCC and clang, not just one or the other. Introduce __diag_GCC_all so that developers can write __diag_ignore(GCC, all, ...); to disable a particular diagnostic for all versions of GCC, while not affecting clang. Closes: https://lore.kernel.org/r/CAHk-=wgfX9nBGE0Ap9GjhOy7Mn=RSy=rx0MvqfYFFDx31KJXqQ@mail.gmail.com Signed-off-by: Nathan Chancellor <[email protected]> Tested-by: Andy Shevchenko <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://patch.msgid.link/20250404-vsprintf-convert-pragmas-to-__diag-v1-1-5d6c5c55b2bd@kernel.org Signed-off-by: Petr Mladek <[email protected]>
1 parent bd67c1c commit 7efa84b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
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

0 commit comments

Comments
 (0)