Re: [PATCH v2 bpf-next] compiler-gcc: Suppress -Wmissing-prototypes warning for all supported GCC

Arnd Bergmann
2023-11-10T06:35:09Z

On Thu, Nov 9, 2023, at 19:23, Alexei Starovoitov wrote:
> On Sun, Nov 5, 2023 at 7:18 PM Yafang Shao <laoar.shao@gmail.com> wrote:
>> In the future, if you wish to suppress warnings that are only supported on
>> higher GCC versions, it is advisable to explicitly use "__diag_ignore" to
>> specify the GCC version you are targeting.
>>
>> Reported-by: kernel test robot <lkp@intel.com>
>> Closes: https://lore.kernel.org/oe-kbuild-all/202311031651.A7crZEur-lkp@intel.com/
>> Suggested-by: Arnd Bergmann <arnd@arndb.de>
>> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
>> Cc: Kumar Kartikeya Dwivedi <memxor@gmail.com>
>> Cc: Arnd Bergmann <arnd@arndb.de>
>> ---
>> include/linux/compiler-gcc.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
>> index 7af9e34..80918bd 100644
>> --- a/include/linux/compiler-gcc.h
>> +++ b/include/linux/compiler-gcc.h
>> @@ -138,7 +138,7 @@
>> #endif
>>
>> #define __diag_ignore_all(option, comment) \
>> - __diag_GCC(8, ignore, option)
>> + __diag(__diag_GCC_ignore option)
>
> Arnd,
> does this look good to you?

Yes, this is good. We could do the same thing for
clang already, but it doesn't make a huge difference.

Acked-by: Arnd Bergmann <arnd@arndb.de>