[PATCH 01/22] kbuild: disable -Wformat-truncation warnings by default
From: Arnd Bergmann
Date: Fri Jul 14 2017 - 08:09:06 EST
With x86 allmodconfig, we currently get 233 -Wformat-truncation warnings,
which makes the entire warnings rather useless.
This turns off the warning by default, unless we specify W=1 or higher
Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
---
scripts/Makefile.extrawarn | 3 +++
1 file changed, 3 insertions(+)
diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
index fb3522fd8702..4b63c2f71adb 100644
--- a/scripts/Makefile.extrawarn
+++ b/scripts/Makefile.extrawarn
@@ -67,5 +67,8 @@ KBUILD_CFLAGS += $(call cc-disable-warning, format)
KBUILD_CFLAGS += $(call cc-disable-warning, sign-compare)
KBUILD_CFLAGS += $(call cc-disable-warning, format-zero-length)
KBUILD_CFLAGS += $(call cc-disable-warning, uninitialized)
+else
+# noisy gcc-7 warnings
+KBUILD_CFLAGS += $(call cc-option,-Wformat-truncation=0)
endif
endif
--
2.9.0