summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2013-02-15 21:23:58 +0100
committerArnd Bergmann <arnd@arndb.de>2013-04-29 16:52:40 +0200
commite74fc973b6e531fef1fce8b101ffff05ecfb774c (patch)
treea654b1ee18ba36ff2dd1689496dac03965c92c00 /Makefile
parent7b2fea1ca77fdfd5154ce0f39fca3f6f335505e8 (diff)
downloadlinux-stable-e74fc973b6e531fef1fce8b101ffff05ecfb774c.tar.gz
linux-stable-e74fc973b6e531fef1fce8b101ffff05ecfb774c.tar.bz2
linux-stable-e74fc973b6e531fef1fce8b101ffff05ecfb774c.zip
Turn off -Wmaybe-uninitialized when building with -Os
gcc-4.7 and higher add a lot of false positive warnings about potential uses of uninitialized warnings, but only when optimizing for size (-Os). This is the default when building allyesconfig, which turns on CONFIG_CC_OPTIMIZE_FOR_SIZE. In order to avoid getting a lot of patches that initialize such variables and accidentally hide real errors along the way, let's just turn off this warning on the respective gcc versions when building with size optimizations. The -Wmaybe-uninitialized option was introduced in the same gcc version (4.7) that is now causing the false positives, so there is no effect on older compilers. A side effect is that when building with CONFIG_CC_OPTIMIZE_FOR_SIZE, we might now see /fewer/ warnings about possibly uninitialized warnings than with -O2, but that is still much better than seeing warnings known to be bogus. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 58a165b02af1..8004421a93d1 100644
--- a/Makefile
+++ b/Makefile
@@ -570,7 +570,7 @@ endif # $(dot-config)
all: vmlinux
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
-KBUILD_CFLAGS += -Os
+KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,)
else
KBUILD_CFLAGS += -O2
endif