correct disabling of -Wshift-negative-value
PATCH 1/1 correct disabling of -Wshift-negative-value
The warning is supported only from gcc6 onwards, hence its disabling needs probing that the (positive) option is actually supported.
scripts/Makefile.extrawarn +1 -1
@@ -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
Nathan Chancellor
maintainerHi Jan,
Quoted 5 lines · Jan Beulich
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 <[email protected]>
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/[email protected]/
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?
scripts/Makefile.extrawarn else · line 160
Quoted 11 lines
scripts/Makefile.extrawarn +1
-1@@ -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
Quoted 12 lines · Nathan Chancellor
Quoted 5 lines · Jan Beulich
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 <[email protected]>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?
Quoted 4 lines
https://lore.kernel.org/[email protected]/
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
Nathan Chancellor
maintainerQuoted 13 lines · Jan Beulich
Quoted 12 lines · Nathan Chancellor
Quoted 5 lines · Jan Beulich
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 <[email protected]>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?
Quoted 6 lines
Quoted 4 lines
https://lore.kernel.org/[email protected]/
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.
Quoted 3 lines
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
Quoted 19 lines · Nathan Chancellor
Quoted 18 lines · Jan Beulich
Quoted 16 lines · Nathan Chancellor
Quoted 5 lines · Jan Beulich
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 <[email protected]>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/[email protected]/
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?
Quoted 6 lines
Quoted 1 line
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
Quoted 12 lines
Quoted 3 lines
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