Re: [PATCH v2 2/2] powerpc/math-emu: Remove -w build flag and fix warnings

From
Nathan Chancellor <nathan@kernel.org>
Date
2022-09-02 16:15:39
Also in
lkml
Reply to
Segher Boessenkool, 2022-09-02
On Fri, Sep 02, 2022 at 10:59:54AM -0500, Segher Boessenkool wrote:
On Fri, Sep 02, 2022 at 08:37:23AM -0700, Nathan Chancellor wrote:
quoted
On Fri, Sep 02, 2022 at 12:08:55PM +0200, Christophe Leroy wrote:
quoted
This should have been detected by gcc at build time, but due to
'-w' flag it went undetected.

Removing that flag leads to many warnings hence errors.
quoted
Thanks for figuring out what was going on here! I took this patch for a
spin with clang and it has a few more errors around
-Wimplicit-fallthrough:
Maybe add -Wno-implicit-fallthrough?  This code is a copy from outside
the kernel, no one has ever wanted to maintain it, if nothing else (the
more politically correct formulation is "we cannot as easily pick up
improvements from upstream if we modify stuff").
Sure, we could do something like this if you preferred:
diff --git a/arch/powerpc/math-emu/Makefile b/arch/powerpc/math-emu/Makefile
index 26fef2e5672e..ed775747a2a5 100644
--- a/arch/powerpc/math-emu/Makefile
+++ b/arch/powerpc/math-emu/Makefile
@@ -16,3 +16,7 @@ obj-$(CONFIG_SPE)		+= math_efp.o
 
 CFLAGS_fabs.o = -fno-builtin-fabs
 CFLAGS_math.o = -fno-builtin-fabs
+
+ifdef CONFIG_CC_IS_CLANG
+ccflags-remove-y := $(CONFIG_CC_IMPLICIT_FALLTHROUGH)
+endif
At the same time, I see other modifications to these files that appear
to be for the kernel only so I suspect that this is already in the "we
cannot as easily pick up improvements from upstream" category,
regardless of that diff. No strong opinion from me, although I see
Christophe already included my suggestion in the most recent series:

https://lore.kernel.org/2663961738a46073713786d4efeb53100ca156e7.1662134272.git.christophe.leroy@csgroup.eu/ (local)

Cheers,
Nathan
Thread (7 messages) 7 messages, 3 authors, last reply 2022-09-02
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help