[PATCH] kbuild: add -Werror=implicit-function-declaration

Masahiro Yamada yamada.masahiro at socionext.com
Thu May 7 14:21:27 CEST 2020


Add -Werror=implicit-function-declaration as Linux does.

If you do not check the prototype, it may go wrong run-time.
It is better to break the build, and require to include correct
headers.

Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
---

 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index cc99873062..f8b136a07f 100644
--- a/Makefile
+++ b/Makefile
@@ -419,7 +419,7 @@ CHECKFLAGS     := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
 KBUILD_CPPFLAGS := -D__KERNEL__ -D__UBOOT__
 
 KBUILD_CFLAGS   := -Wall -Wstrict-prototypes \
-		   -Wno-format-security \
+		   -Werror=implicit-function-declaration -Wno-format-security \
 		   -fno-builtin -ffreestanding $(CSTD_FLAG)
 KBUILD_CFLAGS	+= -fshort-wchar -fno-strict-aliasing
 KBUILD_AFLAGS   := -D__ASSEMBLY__
-- 
2.25.1



More information about the U-Boot mailing list