MIPS: Kbuild: remove -Werror
Subsystems (2)
PATCH 1/2 MIPS: Kbuild: remove -Werror
From: Artem Bityutskiy <[email protected]>
MIPS build fails with the standard W=1 Kbuild switch with because of the -Werror gcc switch.
This patch removes the gcc switch to make W=1 work. Mips is the only architecture I know which does not build with W=1 and this upsets my aiaiai scripts. And in general, you never know which warnings newer versions of gcc will start emiting so having -Werror by default is not the best idea.
--- arch/mips/Kbuild | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)
arch/mips/Kbuild +0 -5
@@ -1,8 +1,3 @@ -# Fail on warnings - also for files referenced in subdirs -# -Werror can be disabled for specific files using: -# CFLAGS_<file.o> := -Wno-error -subdir-ccflags-y := -Werror - # platform specific definitions include arch/mips/Kbuild.platforms obj-y := $(platform-y)
Signature · 1 line
1.7.9.1
PATCH 2/2 MIPS: bcm63xx: kbuild: remove -Werror
From: Artem Bityutskiy <[email protected]>
I cannot build bcm963xx with the standard Kbuild W=1 switch:
arch/mips/bcm63xx/boards/board_bcm963xx.c: At top level:arch/mips/bcm63xx/boards/board_bcm963xx.c:647:5: error: no previous prototype for 'bcm63xx_get_fallback_sprom' [-Werror=missing-prototypes]
cc1: all warnings being treated as errors
This patch removes the gcc switch to make W=1 work. Mips is the only architecture I know which does not build with W=1 and this upsets my aiaiai scripts. And in general, you never know which warnings newer versions of gcc will start emiting so having -Werror by default is not the best idea.
--- arch/mips/bcm63xx/boards/Makefile | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
arch/mips/bcm63xx/boards/Makefile +0 -2
@@ -1,3 +1 @@ obj-$(CONFIG_BOARD_BCM963XX) += board_bcm963xx.o - -ccflags-y := -Werror
Signature · 1 line
1.7.9.1
Re: [PATCH 2/2] MIPS: bcm63xx: kbuild: remove -Werror
Quoted 4 lines · Artem Bityutskiy
From: Artem Bityutskiy <[email protected]>
I cannot build bcm963xx with the standard
KbuildW=1 switch:
Quoted 8 lines
arch/mips/bcm63xx/boards/board_bcm963xx.c: At top level:arch/mips/bcm63xx/boards/board_bcm963xx.c:647:5: error: no previous prototype for 'bcm63xx_get_fallback_sprom' [-Werror=missing-prototypes]
cc1: all warnings being treated as errorsThis patch removes the gcc switch to make W=1 work. Mips is the only architecture I know which does not build with W=1 and this upsets my aiaiai scripts. And in general, you never know which warnings newer versions of gcc will start emiting so having -Werror by default is not the best idea.
If the function has no prototype, then it cannot be reasonably used from
outside -- perhaps you meant to mark it static instead?
Maciej
Re: [PATCH 2/2] MIPS: bcm63xx: kbuild: remove -Werror
Quoted 10 lines · Maciej W. Rozycki
Quoted 8 lines · Artem Bityutskiy
From: Artem Bityutskiy <[email protected]>
I cannot build bcm963xx with the standard
KbuildW=1 switch:
arch/mips/bcm63xx/boards/board_bcm963xx.c: At top level:arch/mips/bcm63xx/boards/board_bcm963xx.c:647:5: error: no previous prototype for 'bcm63xx_get_fallback_sprom' [-Werror=missing-prototypes]
cc1: all warnings being treated as errors
Quoted 7 lines
Quoted 4 lines
This patch removes the gcc switch to make W=1 work. Mips is the only architecture I know which does not build with W=1 and this upsets my aiaiai scripts. And in general, you never know which warnings newer versions of gcc will start emiting so having -Werror by default is not the best idea.
If the function has no prototype, then it cannot be reasonably used from
outside -- perhaps you meant to mark it static instead?
No, I meant what I meant - MIPS does not build with W=1.
Signature · 2 lines
Best Regards, Artem Bityutskiy
Re: [PATCH 2/2] MIPS: bcm63xx: kbuild: remove -Werror
In reply to Artem BityutskiyQuoted 23 lines · Artem Bityutskiy
From: Artem Bityutskiy <[email protected]>
I cannot build bcm963xx with the standard
KbuildW=1 switch:
arch/mips/bcm63xx/boards/board_bcm963xx.c: At top level:arch/mips/bcm63xx/boards/board_bcm963xx.c:647:5: error: no previous prototype for 'bcm63xx_get_fallback_sprom' [-Werror=missing-prototypes]
cc1: all warnings being treated as errorsThis patch removes the gcc switch to make W=1 work. Mips is the only architecture I know which does not build with W=1 and this upsets my aiaiai scripts. And in general, you never know which warnings newer versions of gcc will start emiting so having -Werror by default is not the best idea.
Signed-off-by Artem Bityutskiy <[email protected]>--- arch/mips/bcm63xx/boards/Makefile | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)arch/mips/bcm63xx/boards/Makefile +0
-0
arch/mips/bcm63xx/boards/Makefile line 3
Quoted 3 lines
arch/mips/bcm63xx/boards/Makefile +0
-2@@ -1,3 +1 @@ obj-$(CONFIG_BOARD_BCM963XX) += board_bcm963xx.o - -ccflags-y := -Werror
There's been a whole bunch of other -Werrors below arch/mips some of which even were combined with -Wall. I removed all off them except the central -Werror in arch/mips/Kbuild. I'm pondering a better solution for that one now.
Ralf
Quoted 11 lines · Artem Bityutskiy
From: Artem Bityutskiy<[email protected]>
MIPS build fails with the standard W=1
Kbuildswitch with because of the -Werror gcc switch.This patch removes the gcc switch to make W=1 work. Mips is the only architecture I know which does not build with W=1 and this upsets my aiaiai scripts. And in general, you never know which warnings newer versions of gcc will start emiting so having -Werror by default is not the best idea.
Signed-off-by Artem Bityutskiy<[email protected]>
I think the warning messages are enough, we don't need to break things.
Quoted 17 lines
--- arch/mips/Kbuild | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)arch/mips/Kbuild +0
-5@@ -1,8 +1,3 @@ -# Fail on warnings - also for files referenced in subdirs -# -Werror can be disabled for specific files using: -# CFLAGS_<file.o> := -Wno-error -subdir-ccflags-y := -Werror - # platform specific definitions include arch/mips/Kbuild.platforms obj-y := $(platform-y)
Quoted 11 lines · David Daney
Quoted 9 lines
MIPS build fails with the standard W=1
Kbuildswitch with because of the -Werror gcc switch.This patch removes the gcc switch to make W=1 work. Mips is the only architecture I know which does not build with W=1 and this upsets my aiaiai scripts. And in general, you never know which warnings newer versions of gcc will start emiting so having -Werror by default is not the best idea.
Signed-off-by Artem Bityutskiy<[email protected]>I think the warning messages are enough, we don't need to break things.
I disagree. People generally don't fix their broken code just because it
triggers warnings. The cases where GCC is genuinely confused are the minority -- and even if so, chances are the human reader of that code will also be.
Maciej
Quoted 10 lines · Maciej W. Rozycki
Quoted 8 lines · David Daney
Quoted 8 lines
MIPS build fails with the standard W=1
Kbuildswitch with because of the -Werror gcc switch.This patch removes the gcc switch to make W=1 work. Mips is the only architecture I know which does not build with W=1 and this upsets my aiaiai scripts. And in general, you never know which warnings newer versions of gcc will start emiting so having -Werror by default is not the best idea.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Artem Bityutskiy<[email protected]>I think the warning messages are enough, we don't need to break things.
I disagree. People generally don't fix their broken code just because it
triggers warnings. The cases where GCC is genuinely confused are the minority -- and even if so, chances are the human reader of that code will also be.
Aggressive opinion, nothing more. A patch which fixes the real issue a better way would be way more respectful.
Signature · 2 lines
Best Regards, Artem Bityutskiy
Quoted 7 lines · Artem Bityutskiy
Quoted 4 lines
I disagree. People generally don't fix their broken code just because it
triggers warnings. The cases where GCC is genuinely confused are the minority -- and even if so, chances are the human reader of that code will also be.Aggressive opinion, nothing more. A patch which fixes the real issue a better way would be way more respectful.
I didn't trigger the issue, so I have nothing to fix. I would if it was
me who did.
And my opinion is based on experience. Please check the LMO archives for
why Ralf added this option in the first place -- many years ago. It's probably recorded in the git repository too (I'm not sure if the option was added before or after we moved away from CVS, but in any case old change logs have been imported when our current repo was created).
Maciej
Quoted 5 lines · Maciej W. Rozycki
And my opinion is based on experience. Please check the LMO archives for
why Ralf added this option in the first place -- many years ago. It's probably recorded in the git repository too (I'm not sure if the option was added before or after we moved away from CVS, but in any case old change logs have been imported when our current repo was created).
We need to figure out how to make -Werror be applied only when we do not have W=[123].
Signature · 2 lines
Best Regards, Artem Bityutskiy
Quoted 8 lines · Artem Bityutskiy
Quoted 5 lines
And my opinion is based on experience. Please check the LMO archives for
why Ralf added this option in the first place -- many years ago. It's probably recorded in the git repository too (I'm not sure if the option was added before or after we moved away from CVS, but in any case old change logs have been imported when our current repo was created).We need to figure out how to make -Werror be applied only when we do not have W=[123].
Hmm, that sounds better, however has the counter-intuitive side-effect of
lowering the severity of the warnings that are enabled even without W=[123].
Modern versions of GCC have that selective -Wno-error=foo option and I
think it should be possible to build the precise list of warnings not to choke on locally in arch/mips/Kbuild with little Makefile magic, falling back to something sane for older GCC versions (I'm not sure exactly when these selective options were added, certainly sometime between 4.1 and 4.3).
This will be a bit imperfect if any of these additional -Wfoo options
duplicate ones already added to KBUILD_CFLAGS in our top-level Makefile (either explicitly or via -Wall), but that's about the best we can do. I'll see if I can cook up something quickly.
Maciej
Hi,
Quoted 22 lines · Maciej W. Rozycki
Quoted 8 lines · Artem Bityutskiy
Quoted 5 lines
And my opinion is based on experience. Please check the LMO archives for why Ralf added this option in the first place -- many years ago. It's probably recorded in the git repository too (I'm not sure if the option was added before or after we moved away from CVS, but in any case old change logs have been imported when our current repo was created).
We need to figure out how to make -Werror be applied only when we do not have W=[123].
Hmm, that sounds better, however has the counter-intuitive side-effect of lowering the severity of the warnings that are enabled even without W=[123].
Modern versions of GCC have that selective -Wno-error=foo option and I think it should be possible to build the precise list of warnings not to choke on locally in
arch/mips/Kbuildwith littleMakefilemagic, falling back to something sane for older GCC versions (I'm not sure exactly when these selective options were added, certainly sometime between 4.1 and 4.3).
Quoted 4 lines
This will be a bit imperfect if any of these additional -Wfoo options duplicate ones already added to
KBUILD_CFLAGSin our top-levelMakefile(either explicitly or via -Wall), but that's about the best we can do. I'll see if I can cook up something quickly.
Hm, how about doing it the other way round, i.e. explicitly enable which warnings we want to treat as errors with -Werror=foo? That way we don't lower the severity when W=[123] and new default enabled warnings in gcc can't break the build any more, just better (or worse ;-) heuristics can.
Jonas