linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Nicolas Schier <nicolas@fjasle.eu>
Cc: Randy Dunlap <rdunlap@infradead.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Yann Droneaud <ydroneaud@opteya.com>,
	Michal Marek <michal.lkml@markovi.net>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCHv1] kbuild: support W=e to make build abort in case of warning
Date: Fri, 15 Apr 2022 00:15:40 +0900	[thread overview]
Message-ID: <CAK7LNARVKL4vCRHz5=_sW_oBpkpqhDu5Hp1hfG+Hnwqg-61HVA@mail.gmail.com> (raw)
In-Reply-To: <YlgdF9qmJyYGHKXZ@bergen.fjasle.eu>

On Thu, Apr 14, 2022 at 10:19 PM Nicolas Schier <nicolas@fjasle.eu> wrote:
>
> På lø. 09. april 2022 kl. 10.47 +0000 skrev Masahiro Yamada:
> > On Sat, Apr 9, 2022 at 5:36 AM Randy Dunlap <rdunlap@infradead.org> Wrote:
> > >
> > >
> > >
> > > On 4/8/22 13:29, Nick Desaulniers wrote:
> > > > On Fri, Apr 8, 2022 at 4:06 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
> > > >>
> > > >> On Fri, Apr 8, 2022 at 5:46 PM Yann Droneaud <ydroneaud@opteya.com> wrote:
> > > >>>
> > > >>> When developing new code/feature, CONFIG_WERROR is most
> > > >>> often turned off, especially for people using make W=12 to
> > > >>> get more warnings.
> > > >>>
> > > >>> In such case, turning on -Werror temporarily would require
> > > >>> switching on CONFIG_WERROR in the configuration, building,
> > > >>> then switching off CONFIG_WERROR.
> > > >>>
> > > >>> For this use case, this patch introduces a new 'e' modifier
> > > >>> to W= as a short hand for KCFLAGS+=-Werror" so that -Werror
> > > >>> got added to the kernel (built-in) and modules' CFLAGS.
> > > >>>
> > > >>> Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
> > > >>> ---
> > > >>>  Makefile                   |  1 +
> > > >>>  scripts/Makefile.extrawarn | 13 +++++++++++--
> > > >>>  2 files changed, 12 insertions(+), 2 deletions(-)
> > > >>>
> > > >>> Changes since v0[0]:
> > > >>>
> > > >>>  - rebase on top of commit 64a91907c896 ("kbuild: refactor scripts/Makefile.extrawarn")
> > > >>>  - document use case after commit 3fe617ccafd6 ("Enable '-Werror' by default for all kernel builds")
> > > >>>
> > > >>> [0] https://lore.kernel.org/all/1422803720-14723-1-git-send-email-ydroneaud@opteya.com/
> > > >>
> > > >>
> > > >> I remembered the previous submission, I liked it, but I had lost it.
> > > >>
> > > >> It seems already 7 years ago, (before I became the Kbuild maintainer).
> > > >> Thanks for coming back to this.
> > > >>
> > > >>
> > > >> I like this, but I will wait some time for review comments.
> > > >
> > > > Dunno, this seems pretty simple:
> > > >
> > > > $ ./scripts/config -e WERROR
> > > > $ make ... W=12
> > >
> > > Yeah, that's about what I was thinking too..
> >
> >
> >
> > But, you cannot change the .config
> > when you build external modules.
> >
> > "make W=e" might be useful for people who strive to
> > keep their downstream modules warning-free.
> >
> >
> > W=e is the same pattern.
> > I do not see much downside.
>
> If I set CONFIG_WERROR=y on the make command line, I could have the
> same result, don't I?
>
>   make CONFIG_WERROR=1 ...
>
> no matter if in-tree or for external kernel modules.

Yes.

If you can change the kernel configuration,
you can enable CONFIG_WERROR.

To build external modules against the read-only
/lib/modules/$(uname -r)/build/,
it is not so feasible to change the .config file, though.


>
> Kind regards,
> Nicolas



-- 
Best Regards
Masahiro Yamada

  reply	other threads:[~2022-04-14 15:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-01 15:15 [PATCH] kbuild: support W=e to make build abort in case of warning Yann Droneaud
2022-04-08  8:46 ` [PATCHv1] " Yann Droneaud
2022-04-08 11:05   ` Masahiro Yamada
2022-04-08 20:29     ` Nick Desaulniers
2022-04-08 20:36       ` Randy Dunlap
2022-04-09  1:47         ` Masahiro Yamada
2022-04-09  1:54           ` Randy Dunlap
2022-04-14 13:09           ` Nicolas Schier
2022-04-14 15:15             ` Masahiro Yamada [this message]
2022-04-14 17:51               ` Nicolas Schier
2022-04-14 20:14                 ` Nicolas Schier
2022-04-20 16:21   ` 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='CAK7LNARVKL4vCRHz5=_sW_oBpkpqhDu5Hp1hfG+Hnwqg-61HVA@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=ndesaulniers@google.com \
    --cc=nicolas@fjasle.eu \
    --cc=rdunlap@infradead.org \
    --cc=torvalds@linux-foundation.org \
    --cc=ydroneaud@opteya.com \
    /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;
as well as URLs for NNTP newsgroup(s).