]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
disable security warning flags when possible
authorMike Frysinger <vapier@gentoo.org>
Mon, 25 Apr 2011 08:06:40 +0000 (08:06 +0000)
committerWolfgang Denk <wd@denx.de>
Tue, 26 Jul 2011 14:35:50 +0000 (16:35 +0200)
Some toolchains enable security warning flags by default, but these don't
really make sense in the u-boot world.  Such as forcing changes like:
-printf(foo);
+printf("%s", foo);

So disable the flags when the compiler supports them.  Linux has already
merged a similar change in their build system.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
config.mk

index ed44d03ad3541736b04f2d0b033a1bc347a5f4ae..e2b440d8b2d71ec869cf95dc15038bc88bbbed7b 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -211,6 +211,10 @@ CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes
 endif
 
 CFLAGS += $(call cc-option,-fno-stack-protector)
+# Some toolchains enable security related warning flags by default,
+# but they don't make much sense in the u-boot world, so disable them.
+CFLAGS += $(call cc-option,-Wno-format-nonliteral)
+CFLAGS += $(call cc-option,-Wno-format-security)
 
 # $(CPPFLAGS) sets -g, which causes gcc to pass a suitable -g<format>
 # option to the assembler.