kbuild: add -Werror=implicit-int flag unconditionally
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 14 Dec 2018 08:05:39 +0000 (17:05 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Sun, 16 Dec 2018 15:33:45 +0000 (00:33 +0900)
This flag is documented in the GCC 4.6 manual, and recognized by
Clang as well. Let's rip off the cc-option switch.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Makefile

index 1ec5289a871f3581fed5755cf76931d753304f9e..b9e902e8e38274c14d8d9c3b2dd49d18caf78512 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -429,7 +429,7 @@ LINUXINCLUDE    := \
 KBUILD_AFLAGS   := -D__ASSEMBLY__ -fno-PIE
 KBUILD_CFLAGS   := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
                   -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
-                  -Werror-implicit-function-declaration \
+                  -Werror-implicit-function-declaration -Werror=implicit-int \
                   -Wno-format-security \
                   -std=gnu89
 KBUILD_CPPFLAGS := -D__KERNEL__
@@ -829,9 +829,6 @@ KBUILD_CFLAGS  += $(call cc-option,-fno-stack-check,)
 # conserve stack if available
 KBUILD_CFLAGS   += $(call cc-option,-fconserve-stack)
 
-# disallow errors like 'EXPORT_GPL(foo);' with missing header
-KBUILD_CFLAGS   += $(call cc-option,-Werror=implicit-int)
-
 # Prohibit date/time macros, which would make the build non-deterministic
 KBUILD_CFLAGS   += $(call cc-option,-Werror=date-time)