mirror of
https://github.com/torvalds/linux
synced 2024-09-06 18:01:05 +00:00
kbuild: add -Werror=strict-prototypes flag unconditionally
-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>
This commit is contained in:
parent
42a92bccd2
commit
eeb5687a71
5
Makefile
5
Makefile
|
@ -427,7 +427,7 @@ LINUXINCLUDE := \
|
||||||
$(USERINCLUDE)
|
$(USERINCLUDE)
|
||||||
|
|
||||||
KBUILD_AFLAGS := -D__ASSEMBLY__ -fno-PIE
|
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 \
|
-fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
|
||||||
-Werror-implicit-function-declaration \
|
-Werror-implicit-function-declaration \
|
||||||
-Wno-format-security \
|
-Wno-format-security \
|
||||||
|
@ -832,9 +832,6 @@ KBUILD_CFLAGS += $(call cc-option,-fconserve-stack)
|
||||||
# disallow errors like 'EXPORT_GPL(foo);' with missing header
|
# disallow errors like 'EXPORT_GPL(foo);' with missing header
|
||||||
KBUILD_CFLAGS += $(call cc-option,-Werror=implicit-int)
|
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
|
# Prohibit date/time macros, which would make the build non-deterministic
|
||||||
KBUILD_CFLAGS += $(call cc-option,-Werror=date-time)
|
KBUILD_CFLAGS += $(call cc-option,-Werror=date-time)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue