Skip to contentSkip to conversation

MIPS: Kbuild: remove -Werror

PATCH In review Artem Bityutskiy 5 participants 12 messages Apr 27, 2012 – May 21, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
index 7dd65cf..0d37730 100644
@@ -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
#1 lore raw

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
index 9f64fb4..af07c1a 100644
@@ -1,3 +1 @@
 obj-$(CONFIG_BOARD_BCM963XX)		+= board_bcm963xx.o
-
-ccflags-y := -Werror
Signature · 1 line
1.7.9.1
#2 lore raw

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 Kbuild W=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 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.

If the function has no prototype, then it cannot be reasonably used from
outside -- perhaps you meant to mark it static instead?

Maciej

#3 lore raw

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 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

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
#4 lore raw

Re: [PATCH 2/2] MIPS: bcm63xx: kbuild: remove -Werror

In reply to Artem Bityutskiy
Quoted 23 lines · Artem Bityutskiy

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 -0
index 9f64fb4..af07c1a 100644

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

Acked-by on v1 1/2
#5 lore raw
In reply to Artem Bityutskiy
Quoted 11 lines · Artem Bityutskiy

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.

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
index 7dd65cf..0d37730 100644
@@ -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)
#6 lore raw
Quoted 11 lines · David Daney
Quoted 9 lines

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.

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

#7 lore raw
Quoted 10 lines · Maciej W. Rozycki
Quoted 8 lines · David Daney
Quoted 8 lines

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.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

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
#8 lore raw
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

#9 lore raw
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
#10 lore raw
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

#11 lore raw

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/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).

Quoted 4 lines

 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.

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