mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Olaf Hering <olaf@aepfle.de>
Cc: Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Michal Marek <michal.lkml@markovi.net>
Subject: Re: [PATCH v1] kbuild: enforce -Werror=return-type
Date: Sun, 11 Oct 2020 22:27:39 +0900	[thread overview]
Message-ID: <CAK7LNAS7JB5ddbnTBv2ARmcSCCtkYFeYWKW_R+5zjCEdJ_P6Gg@mail.gmail.com> (raw)
In-Reply-To: <20201005101026.21951-1-olaf@aepfle.de>

On Mon, Oct 5, 2020 at 7:13 PM Olaf Hering <olaf@aepfle.de> wrote:
>
> 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)
> +



cc-option is unneeded because the minimal supported versions
of GCC/Clang support -Werror=return-type.

You can hard-code and add it around line 500.



>  # Require designated initializers for all marked structures
>  KBUILD_CFLAGS   += $(call cc-option,-Werror=designated-init)
>


-- 
Best Regards
Masahiro Yamada

      reply	other threads:[~2020-10-11 13:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-05 10:10 Olaf Hering
2020-10-11 13:27 ` Masahiro Yamada [this message]

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=CAK7LNAS7JB5ddbnTBv2ARmcSCCtkYFeYWKW_R+5zjCEdJ_P6Gg@mail.gmail.com \
    --to=masahiroy@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=olaf@aepfle.de \
    /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®