]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
cc-option: also detect unsupported warnings options
authorJeroen Hofstee <jeroen@myspectrum.nl>
Wed, 30 Jul 2014 19:54:51 +0000 (21:54 +0200)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Tue, 9 Sep 2014 11:51:00 +0000 (13:51 +0200)
By default clang will echo a warning if a warning option is
unknown. Turning warnings into errors when polling for options
also catches such cases and prevents passing arguments to the
compiler which cause warnings.

cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
cc: Tom Rini <trini@ti.com>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
scripts/Kbuild.include

index c664e39be6a6a193ca9b6448c6c01e28b18099b8..4c333599c1fe19e1775d6f5a51d88b7e87c65262 100644 (file)
@@ -113,12 +113,12 @@ as-instr = $(call try-run,\
 # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
 
 cc-option = $(call try-run,\
-       $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))
+       $(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))
 
 # cc-option-yn
 # Usage: flag := $(call cc-option-yn,-march=winchip-c6)
 cc-option-yn = $(call try-run,\
-       $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n)
+       $(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n)
 
 # cc-option-align
 # Prefix align with either -falign or -malign