* [PATCH] extrawarn: Use cc-disable-warning for shift-negative-value
@ 2025-05-07 5:47 WangYuli
2025-05-08 16:31 ` Nathan Chancellor
0 siblings, 1 reply; 2+ messages in thread
From: WangYuli @ 2025-05-07 5:47 UTC (permalink / raw)
To: masahiroy, nathan, nicolas.schier
Cc: linux-kbuild, linux-kernel, zhanjun, niecheng1, guanwentao,
WangYuli
The -Wno-shift-negative-value option is not supported by GCC 5.4.0.
This could potentially result in extra warnings under certain
circumstances.
Utilize cc-disable-warning to prevent the following from occurring:
mm/vmscan.c: At top level:
cc1: error: unrecognized command line option ‘-Wno-shift-negative-value’ [-Werror]
cc1: all warnings being treated as errors
Link: https://lore.kernel.org/all/62726950F697595A+20250507040827.1147510-1-wangyuli@uniontech.com/
Signed-off-by: WangYuli <wangyuli@uniontech.com>
---
| 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
index d88acdf40855..375475e7b3bd 100644
--- a/scripts/Makefile.extrawarn
+++ b/scripts/Makefile.extrawarn
@@ -158,7 +158,7 @@ else
# The following turn off the warnings enabled by -Wextra
KBUILD_CFLAGS += -Wno-missing-field-initializers
KBUILD_CFLAGS += -Wno-type-limits
-KBUILD_CFLAGS += -Wno-shift-negative-value
+KBUILD_CFLAGS += $(call cc-disable-warning, shift-negative-value)
ifdef CONFIG_CC_IS_CLANG
KBUILD_CFLAGS += -Wno-enum-enum-conversion
--
2.49.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] extrawarn: Use cc-disable-warning for shift-negative-value
2025-05-07 5:47 [PATCH] extrawarn: Use cc-disable-warning for shift-negative-value WangYuli
@ 2025-05-08 16:31 ` Nathan Chancellor
0 siblings, 0 replies; 2+ messages in thread
From: Nathan Chancellor @ 2025-05-08 16:31 UTC (permalink / raw)
To: WangYuli
Cc: masahiroy, nicolas.schier, linux-kbuild, linux-kernel, zhanjun,
niecheng1, guanwentao
On Wed, May 07, 2025 at 01:47:05PM +0800, WangYuli wrote:
> The -Wno-shift-negative-value option is not supported by GCC 5.4.0.
The patch is fine (albeit slightly incomplete because other places add
this unconditionally) but this is not going to matter soon because the
minimum version of GCC is being bumped to 8.1:
https://git.kernel.org/next/linux-next/c/118c40b7b50340bf7ff7e0adee8e3bab6e552c82
Even though we claim to support GCC 5, I suspect that basically nobody
uses it in practice since this flag was added by 1344794a59db2.
> This could potentially result in extra warnings under certain
> circumstances.
>
> Utilize cc-disable-warning to prevent the following from occurring:
> mm/vmscan.c: At top level:
> cc1: error: unrecognized command line option ‘-Wno-shift-negative-value’ [-Werror]
> cc1: all warnings being treated as errors
>
> Link: https://lore.kernel.org/all/62726950F697595A+20250507040827.1147510-1-wangyuli@uniontech.com/
> Signed-off-by: WangYuli <wangyuli@uniontech.com>
> ---
> scripts/Makefile.extrawarn | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
> index d88acdf40855..375475e7b3bd 100644
> --- a/scripts/Makefile.extrawarn
> +++ b/scripts/Makefile.extrawarn
> @@ -158,7 +158,7 @@ else
> # The following turn off the warnings enabled by -Wextra
> KBUILD_CFLAGS += -Wno-missing-field-initializers
> KBUILD_CFLAGS += -Wno-type-limits
> -KBUILD_CFLAGS += -Wno-shift-negative-value
> +KBUILD_CFLAGS += $(call cc-disable-warning, shift-negative-value)
>
> ifdef CONFIG_CC_IS_CLANG
> KBUILD_CFLAGS += -Wno-enum-enum-conversion
> --
> 2.49.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-05-08 16:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-07 5:47 [PATCH] extrawarn: Use cc-disable-warning for shift-negative-value WangYuli
2025-05-08 16:31 ` Nathan Chancellor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox