kbuild: enforce -Werror=return-type
authorOlaf Hering <olaf@aepfle.de>
Sun, 11 Oct 2020 18:54:31 +0000 (20:54 +0200)
committerMasahiro Yamada <masahiroy@kernel.org>
Mon, 12 Oct 2020 00:24:11 +0000 (09:24 +0900)
Catch errors which at least gcc tolerates by default:
 warning: 'return' with no value, in function returning non-void [-Wreturn-type]

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Makefile

index ddadab2..b76c412 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -497,7 +497,7 @@ 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-int \
-                  -Wno-format-security \
+                  -Werror=return-type -Wno-format-security \
                   -std=gnu89
 KBUILD_CPPFLAGS := -D__KERNEL__
 KBUILD_AFLAGS_KERNEL :=