]> git.sur5r.net Git - u-boot/commitdiff
Makefile: Update clang warning disables from Linux
authorTom Rini <trini@konsulko.com>
Sun, 22 Apr 2018 14:20:50 +0000 (10:20 -0400)
committerTom Rini <trini@konsulko.com>
Fri, 27 Apr 2018 18:54:48 +0000 (14:54 -0400)
Re-sync the logic about which clang warnings to disable from v4.17-rc1.
Note that we don't disable all of the same ones as for now we haven't
run into any cases of warnings from clang in code from upstream Linux.

Signed-off-by: Tom Rini <trini@konsulko.com>
Makefile

index 64351eb769e2057ad45c0bd7fb38384136cccbce..143644c98759b6b0c6b89ce2587647e5ea47b566 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -610,6 +610,13 @@ endif
 endif
 
 KBUILD_CFLAGS += $(call cc-option,-Wno-format-nonliteral)
+ifeq ($(cc-name),clang)
+KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
+KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
+KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
+KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
+KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
+endif
 
 # turn jbsr into jsr for m68k
 ifeq ($(ARCH),m68k)