From: Olaf Hering <olaf@aepfle.de>
To: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Olaf Hering <olaf@aepfle.de>,
Masahiro Yamada <masahiroy@kernel.org>,
Michal Marek <michal.lkml@markovi.net>
Subject: [PATCH v1] kbuild: enforce -Werror=return-type
Date: Mon, 5 Oct 2020 12:10:26 +0200 [thread overview]
Message-ID: <20201005101026.21951-1-olaf@aepfle.de> (raw)
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>
---
Makefile | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Makefile b/Makefile
index f84d7e4ca0be..7b2e63e7be18 100644
--- a/Makefile
+++ b/Makefile
@@ -942,6 +942,9 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=date-time)
# enforce correct pointer usage
KBUILD_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types)
+# enforce correct return type
+KBUILD_CFLAGS += $(call cc-option,-Werror=return-type)
+
# Require designated initializers for all marked structures
KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init)
next reply other threads:[~2020-10-05 10:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-05 10:10 Olaf Hering [this message]
2020-10-11 13:27 ` Masahiro Yamada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201005101026.21951-1-olaf@aepfle.de \
--to=olaf@aepfle.de \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=michal.lkml@markovi.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®