Dne 31.7.2014 18:12, Behan Webster napsal(a):Hmm. You're right. Will fix.
On 07/31/14 01:18, Michal Marek wrote:You placed it inside a branch that is only evaluated when W= is given.
Dne 31.7.2014 06:16, behanw@xxxxxxxxxxxxxxxxxx napsal(a):Actually they are annoying, that's why they're disabled normally. Most
@@ -55,6 +45,18 @@ warning-3 += -Wswitch-defaultPlease remove this part, it has no effect. I assume that if it works for
warning-3 += $(call cc-option, -Wpacked-bitfield-compat)
warning-3 += $(call cc-option, -Wvla)
+ifeq ($(COMPILER),clang)
+ifndef $(W)
+KBUILD_CFLAGS += $(call cc-disable-warning, initializer-overrides)
+KBUILD_CFLAGS += $(call cc-disable-warning, unused-value)
+KBUILD_CFLAGS += $(call cc-disable-warning, format)
+KBUILD_CFLAGS += $(call cc-disable-warning, unknown-warning-option)
+KBUILD_CFLAGS += $(call cc-disable-warning, sign-compare)
+KBUILD_CFLAGS += $(call cc-disable-warning, format-zero-length)
+KBUILD_CFLAGS += $(call cc-disable-warning, uninitialized)
+endif
+endif
+
you, these warning are not as annoying so they do not need to be
disabled?
of them complain about practices which are relatively common in kernel
code.
clang warns about a lot more things than gcc does. It means that code
which compiles cleanly in gcc often doesn't with clang. This cuts out
the warnings which are unlikely to to be fixed in kernel code anytime
soon, but which are probably worth exposing when W=1 is used.
This part of the patch explicitly deals with complaints from some in the
kernel community that clang is too noisy with kernel code.
This part of the patch needs to be somewhere. This seemed the best place.