net: wwan: t7xx: do not compile with -Werror by default
PATCH 1/1 net: wwan: t7xx: do not compile with -Werror by default
When playing with various compilers or their versions, some choke on the t7xx code. For example (with gcc 13):
In file included from ./arch/s390/include/generated/asm/rwonce.h:1,
from ../include/linux/compiler.h:247,
from ../include/linux/build_bug.h:5,
from ../include/linux/bits.h:22,
from ../drivers/net/wwan/t7xx/t7xx_state_monitor.c:17:
In function 'preempt_count',
inlined from 't7xx_fsm_append_event' at ../drivers/net/wwan/t7xx/t7xx_state_monitor.c:439:43: ../include/asm-generic/rwonce.h:44:26: error: array subscript 0 is outside array bounds of 'const volatile int[0]' [-Werror=array-bounds=]
There is no reason for any code in the kernel to be built with -Werror by default. Note that we have generic CONFIG_WERROR. OTOH, some drivers may want to do this only on per-driver basis. Some do CONFIG_DRM_I915_WERROR or alike. But I reused the scsi's:
ifdef WARNINGS_BECOME_ERRORS
approach.
Now, if one wants to build t7xx with -Werror, they may say:
make WARNINGS_BECOME_ERRORS=1
--- drivers/net/wwan/t7xx/Makefile | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wwan/t7xx/Makefile +2 -0
@@ -1,6 +1,8 @@ # SPDX-License-Identifier: GPL-2.0-only +ifdef WARNINGS_BECOME_ERRORS ccflags-y += -Werror +endif obj-${CONFIG_MTK_T7XX} := mtk_t7xx.o mtk_t7xx-y:= t7xx_pci.o \
Signature · 1 line
2.40.0
Jakub Kicinski
maintainerQuoted 9 lines · On Wed, 29 Mar 2023 12:26:39 +0200 Jiri Slaby (SUSE) wrote:
There is no reason for any code in the kernel to be built with -Werror by default. Note that we have generic
CONFIG_WERROR. OTOH, some drivers may want to do this only on per-driver basis. Some doCONFIG_DRM_I915_WERRORor alike. But I reused the scsi's:
ifdefWARNINGS_BECOME_ERRORS
approach.Now, if one wants to build t7xx with -Werror, they may say:
make WARNINGS_BECOME_ERRORS=1
As you said we have CONFIG_WERROR now, so I'd vote to delete that line completely.
PATCH 1/1 net: wwan: t7xx: do not compile with -Werror
When playing with various compilers or their versions, some choke on the t7xx code. For example (with gcc 13):
In file included from ./arch/s390/include/generated/asm/rwonce.h:1,
from ../include/linux/compiler.h:247,
from ../include/linux/build_bug.h:5,
from ../include/linux/bits.h:22,
from ../drivers/net/wwan/t7xx/t7xx_state_monitor.c:17:
In function 'preempt_count',
inlined from 't7xx_fsm_append_event' at ../drivers/net/wwan/t7xx/t7xx_state_monitor.c:439:43: ../include/asm-generic/rwonce.h:44:26: error: array subscript 0 is outside array bounds of 'const volatile int[0]' [-Werror=array-bounds=]
There is no reason for any code in the kernel to be built with -Werror by default. Note that we have generic CONFIG_WERROR. So if anyone wants -Werror, they can enable that.
---
Notes:
[v2] delete the line completely
drivers/net/wwan/t7xx/Makefile | 2 -- 1 file changed, 2 deletions(-)
drivers/net/wwan/t7xx/Makefile +0 -2
@@ -1,7 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only -ccflags-y += -Werror - obj-${CONFIG_MTK_T7XX} := mtk_t7xx.o mtk_t7xx-y:= t7xx_pci.o \ t7xx_pcie_mac.o \
Signature · 1 line
2.40.0
Re: [PATCH] net: wwan: t7xx: do not compile with -Werror
It should have been [PATCH v2] in the subject. Do you want me to resend?
Quoted 51 lines · Jiri Slaby (SUSE)
When playing with various compilers or their versions, some choke on the t7xx code. For example (with gcc 13):
In file included from./arch/s390/include/generated/asm/rwonce.h:1,from ../include/linux/compiler.h:247, from ../include/linux/build_bug.h:5, from ../include/linux/bits.h:22, from ../drivers/net/wwan/t7xx/t7xx_state_monitor.c:17: In function 'preempt_count', inlined from 't7xx_fsm_append_event' at ../drivers/net/wwan/t7xx/t7xx_state_monitor.c:439:43:
../include/asm-generic/rwonce.h:44:26: error: array subscript 0 is outside array bounds of 'const volatile int[0]' [-Werror=array-bounds=]There is no reason for any code in the kernel to be built with -Werror by default. Note that we have generic
CONFIG_WERROR. So if anyone wants -Werror, they can enable that.Signed-off-by Jiri Slaby (SUSE) <[email protected]>Cc Chandrashekar Devegowda <[email protected]>Cc Intel Corporation <[email protected]>Cc Chiranjeevi Rapolu <[email protected]>Cc Liu Haijun <[email protected]>Cc M Chetan Kumar <[email protected]>Cc Ricardo Martinez <[email protected]>Cc Loic Poulain <[email protected]>Cc Sergey Ryazanov <[email protected]>Cc Johannes Berg <[email protected]>Cc "David S. Miller" <[email protected]>Cc Eric Dumazet <[email protected]>Cc Jakub Kicinski <[email protected]>Cc Paolo Abeni <[email protected]>---
Notes:
[v2] delete the line completelydrivers/net/wwan/t7xx/Makefile | 2 -- 1 file changed, 2 deletions(-)drivers/net/wwan/t7xx/Makefile +0
-2@@ -1,7 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only -ccflags-y += -Werror - obj-${CONFIG_MTK_T7XX} := mtk_t7xx.o mtk_t7xx-y:= t7xx_pci.o \ t7xx_pcie_mac.o \
Signature · 1 line
js
Jakub Kicinski
maintainerRe: [PATCH] net: wwan: t7xx: do not compile with -Werror
Quoted 1 line · On Fri, 31 Mar 2023 08:36:06 +0200 Jiri Slaby wrote:
It should have been [PATCH v2] in the subject. Do you want me to resend?
It's fine confusing seems unlikely, thanks for respining!
Re: [PATCH] net: wwan: t7xx: do not compile with -Werror
In reply to Jiri Slaby (SUSE)This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:
Quoted 9 lines · On Fri, 31 Mar 2023 08:35:15 +0200 you wrote:
When playing with various compilers or their versions, some choke on the t7xx code. For example (with gcc 13):
In file included from./arch/s390/include/generated/asm/rwonce.h:1,from ../include/linux/compiler.h:247, from ../include/linux/build_bug.h:5, from ../include/linux/bits.h:22, from ../drivers/net/wwan/t7xx/t7xx_state_monitor.c:17: In function 'preempt_count', inlined from 't7xx_fsm_append_event' at ../drivers/net/wwan/t7xx/t7xx_state_monitor.c:439:43:
Quoted 3 lines
../include/asm-generic/rwonce.h:44:26: error: array subscript 0 is outside array bounds of 'const volatile int[0]' [-Werror=array-bounds=][...]
Here is the summary with links:
- net: wwan: t7xx: do not compile with -Werror
https://git.kernel.org/netdev/net/c/362f0b6678ad
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html