kbuild: add -Werror=strict-prototypes flag unconditionally
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 14 Dec 2018 08:05:38 +0000 (17:05 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Sun, 16 Dec 2018 15:33:45 +0000 (00:33 +0900)
-Wstrict-prototypes is added to KBUILD_CFLAGS first, then overridden
by -Werror=strict-prototypes later.

Let's add -Werror=strict-prototypes unconditionally because it is
supported by GCC 4.6, and also by Clang.

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

index 2d15726fb546101e3e0f8e7717c9be322f006d52..1ec5289a871f3581fed5755cf76931d753304f9e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -427,7 +427,7 @@ LINUXINCLUDE    := \
                $(USERINCLUDE)
 
 KBUILD_AFLAGS   := -D__ASSEMBLY__ -fno-PIE
-KBUILD_CFLAGS   := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
+KBUILD_CFLAGS   := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
                   -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
                   -Werror-implicit-function-declaration \
                   -Wno-format-security \
@@ -832,9 +832,6 @@ KBUILD_CFLAGS   += $(call cc-option,-fconserve-stack)
 # disallow errors like 'EXPORT_GPL(foo);' with missing header
 KBUILD_CFLAGS   += $(call cc-option,-Werror=implicit-int)
 
-# require functions to have arguments in prototypes, not empty 'int foo()'
-KBUILD_CFLAGS   += $(call cc-option,-Werror=strict-prototypes)
-
 # Prohibit date/time macros, which would make the build non-deterministic
 KBUILD_CFLAGS   += $(call cc-option,-Werror=date-time)