* [PATCH] correct disabling of -Wshift-negative-value
@ 2025-04-14 14:23 Jan Beulich
2025-04-14 19:38 ` Nathan Chancellor
0 siblings, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2025-04-14 14:23 UTC (permalink / raw)
To: linux-kbuild@vger.kernel.org
Cc: Masahiro Yamada, Nathan Chancellor, Nicolas Schier
The warning is supported only from gcc6 onwards, hence its disabling
needs probing that the (positive) option is actually supported.
Fixes: 1344794a59db ("Kbuild: add -Wno-shift-negative-value where -Wextra is used")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/scripts/Makefile.extrawarn
+++ b/scripts/Makefile.extrawarn
@@ -154,7 +154,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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] correct disabling of -Wshift-negative-value 2025-04-14 14:23 [PATCH] correct disabling of -Wshift-negative-value Jan Beulich @ 2025-04-14 19:38 ` Nathan Chancellor 2025-04-15 5:53 ` Jan Beulich 0 siblings, 1 reply; 5+ messages in thread From: Nathan Chancellor @ 2025-04-14 19:38 UTC (permalink / raw) To: Jan Beulich Cc: linux-kbuild@vger.kernel.org, Masahiro Yamada, Nicolas Schier, Arnd Bergmann Hi Jan, On Mon, Apr 14, 2025 at 04:23:36PM +0200, Jan Beulich wrote: > The warning is supported only from gcc6 onwards, hence its disabling > needs probing that the (positive) option is actually supported. > > Fixes: 1344794a59db ("Kbuild: add -Wno-shift-negative-value where -Wextra is used") > Signed-off-by: Jan Beulich <jbeulich@suse.com> The patch itself seems fine (I might add "scripts/Makefile.extrawarn: " to the title) but if I understand correctly, this is only to support GCC 5? Would this be necessary if GCC 8.1 becomes the minimum supported version of GCC for building the kernel? https://lore.kernel.org/20250407094116.1339199-2-arnd@kernel.org/ If people are actively noticing this, perhaps we should send this to Linus's tree for backports then Arnd could revert it in his series? > --- a/scripts/Makefile.extrawarn > +++ b/scripts/Makefile.extrawarn > @@ -154,7 +154,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 Cheers, Nathan ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] correct disabling of -Wshift-negative-value 2025-04-14 19:38 ` Nathan Chancellor @ 2025-04-15 5:53 ` Jan Beulich 2025-04-15 21:15 ` Nathan Chancellor 0 siblings, 1 reply; 5+ messages in thread From: Jan Beulich @ 2025-04-15 5:53 UTC (permalink / raw) To: Nathan Chancellor Cc: linux-kbuild@vger.kernel.org, Masahiro Yamada, Nicolas Schier, Arnd Bergmann On 14.04.2025 21:38, Nathan Chancellor wrote: > On Mon, Apr 14, 2025 at 04:23:36PM +0200, Jan Beulich wrote: >> The warning is supported only from gcc6 onwards, hence its disabling >> needs probing that the (positive) option is actually supported. >> >> Fixes: 1344794a59db ("Kbuild: add -Wno-shift-negative-value where -Wextra is used") >> Signed-off-by: Jan Beulich <jbeulich@suse.com> > > The patch itself seems fine (I might add "scripts/Makefile.extrawarn: " > to the title) but if I understand correctly, this is only to support GCC > 5? Would this be necessary if GCC 8.1 becomes the minimum supported > version of GCC for building the kernel? > > https://lore.kernel.org/20250407094116.1339199-2-arnd@kernel.org/ > > If people are actively noticing this, perhaps we should send this to > Linus's tree for backports then Arnd could revert it in his series? Actually, aiui that work was meanwhile merged. Hence the patch here is indeed only applicable to stable trees. No idea how such a situation is to be handled. (Apparently the same is true for "correct disabling of -Wstringop-overflow": That option was introduced in gcc7.) Jan ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] correct disabling of -Wshift-negative-value 2025-04-15 5:53 ` Jan Beulich @ 2025-04-15 21:15 ` Nathan Chancellor 2025-04-16 6:07 ` Jan Beulich 0 siblings, 1 reply; 5+ messages in thread From: Nathan Chancellor @ 2025-04-15 21:15 UTC (permalink / raw) To: Jan Beulich Cc: linux-kbuild@vger.kernel.org, Masahiro Yamada, Nicolas Schier, Arnd Bergmann On Tue, Apr 15, 2025 at 07:53:12AM +0200, Jan Beulich wrote: > On 14.04.2025 21:38, Nathan Chancellor wrote: > > On Mon, Apr 14, 2025 at 04:23:36PM +0200, Jan Beulich wrote: > >> The warning is supported only from gcc6 onwards, hence its disabling > >> needs probing that the (positive) option is actually supported. > >> > >> Fixes: 1344794a59db ("Kbuild: add -Wno-shift-negative-value where -Wextra is used") > >> Signed-off-by: Jan Beulich <jbeulich@suse.com> > > > > The patch itself seems fine (I might add "scripts/Makefile.extrawarn: " > > to the title) but if I understand correctly, this is only to support GCC > > 5? Would this be necessary if GCC 8.1 becomes the minimum supported > > version of GCC for building the kernel? > > > > https://lore.kernel.org/20250407094116.1339199-2-arnd@kernel.org/ > > > > If people are actively noticing this, perhaps we should send this to > > Linus's tree for backports then Arnd could revert it in his series? > > Actually, aiui that work was meanwhile merged. Hence the patch here is I think only x86 has been bumped to a minimum of GCC 8.1 so far, done in commit a3e8fe814ad1 ("x86/build: Raise the minimum GCC version to 8.1"). That series is still being reviewed/worked on as far as I can tell, so I think these patches would still be needed for other architectures. > indeed only applicable to stable trees. No idea how such a situation > is to be handled. (Apparently the same is true for "correct disabling > of -Wstringop-overflow": That option was introduced in gcc7.) Normally, you would just send a patch to the stable maintainers and mailing list just like this but the commit message would say something like "<xyz problem> was fixed in mainline in such a way that cannot be easily backported due to <xyz reason> so do <xyz thing> to resolve said problem in the stable trees". Cheers, Nathan ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] correct disabling of -Wshift-negative-value 2025-04-15 21:15 ` Nathan Chancellor @ 2025-04-16 6:07 ` Jan Beulich 0 siblings, 0 replies; 5+ messages in thread From: Jan Beulich @ 2025-04-16 6:07 UTC (permalink / raw) To: Nathan Chancellor Cc: linux-kbuild@vger.kernel.org, Masahiro Yamada, Nicolas Schier, Arnd Bergmann On 15.04.2025 23:15, Nathan Chancellor wrote: > On Tue, Apr 15, 2025 at 07:53:12AM +0200, Jan Beulich wrote: >> On 14.04.2025 21:38, Nathan Chancellor wrote: >>> On Mon, Apr 14, 2025 at 04:23:36PM +0200, Jan Beulich wrote: >>>> The warning is supported only from gcc6 onwards, hence its disabling >>>> needs probing that the (positive) option is actually supported. >>>> >>>> Fixes: 1344794a59db ("Kbuild: add -Wno-shift-negative-value where -Wextra is used") >>>> Signed-off-by: Jan Beulich <jbeulich@suse.com> >>> >>> The patch itself seems fine (I might add "scripts/Makefile.extrawarn: " >>> to the title) but if I understand correctly, this is only to support GCC >>> 5? Would this be necessary if GCC 8.1 becomes the minimum supported >>> version of GCC for building the kernel? >>> >>> https://lore.kernel.org/20250407094116.1339199-2-arnd@kernel.org/ >>> >>> If people are actively noticing this, perhaps we should send this to >>> Linus's tree for backports then Arnd could revert it in his series? >> >> Actually, aiui that work was meanwhile merged. Hence the patch here is > > I think only x86 has been bumped to a minimum of GCC 8.1 so far, done in > commit a3e8fe814ad1 ("x86/build: Raise the minimum GCC version to 8.1"). > That series is still being reviewed/worked on as far as I can tell, so I > think these patches would still be needed for other architectures. Oh, I see. I merely noticed the bump (after sending) on x86. Then what you said in your earlier reply is probably the best that can be done for now (and then also for the other patch). Jan >> indeed only applicable to stable trees. No idea how such a situation >> is to be handled. (Apparently the same is true for "correct disabling >> of -Wstringop-overflow": That option was introduced in gcc7.) > > Normally, you would just send a patch to the stable maintainers and > mailing list just like this but the commit message would say something > like "<xyz problem> was fixed in mainline in such a way that cannot be > easily backported due to <xyz reason> so do <xyz thing> to resolve said > problem in the stable trees". > > Cheers, > Nathan ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-04-16 6:07 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-04-14 14:23 [PATCH] correct disabling of -Wshift-negative-value Jan Beulich 2025-04-14 19:38 ` Nathan Chancellor 2025-04-15 5:53 ` Jan Beulich 2025-04-15 21:15 ` Nathan Chancellor 2025-04-16 6:07 ` Jan Beulich
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox