From: Nathan Chancellor <natechancellor@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Masahiro Yamada <yamada.masahiro@socionext.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>,
clang-built-linux@googlegroups.com,
Nick Desaulniers <ndesaulniers@google.com>
Subject: Re: [PATCH] kbuild: Enable -Wsometimes-uninitialized
Date: Tue, 30 Apr 2019 02:33:52 -0700 [thread overview]
Message-ID: <20190430093352.GA16941@archlinux-i9> (raw)
In-Reply-To: <CAK8P3a0gAnruPgGMFcAfoHpj_zDnsn-RJjYiYUXDDj-CrwoO8A@mail.gmail.com>
On Tue, Apr 30, 2019 at 09:16:50AM +0200, Arnd Bergmann wrote:
> On Tue, Apr 30, 2019 at 3:01 AM Nathan Chancellor
> <natechancellor@gmail.com> wrote:
> >
> > This is Clang's version of GCC's -Wmaybe-uninitialized. Up to this
> > point, it has not been used because -Wuninitialized has been disabled,
> > which also turns off -Wsometimes-uninitialized, meaning that we miss out
> > on finding some bugs [1]. In my experience, it appears to be more
> > accurate than GCC and catch some things that GCC can't.
> >
> > All of these warnings have now been fixed in -next across arm, arm64,
> > and x86_64 defconfig/allyesconfig so this should be enabled for everyone
> > to prevent more from easily creeping in.
> >
> > As of next-20190429:
> >
> > $ git log --oneline --grep="sometimes-uninitialized" | wc -l
> > 45
> >
> > [1]: https://lore.kernel.org/lkml/86649ee4-9794-77a3-502c-f4cd10019c36@lca.pw/
> >
> > Link: https://github.com/ClangBuiltLinux/linux/issues/381
> > Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> > ---
> >
> > Masahiro, I am not sure how you want to handle merging this with regards
> > to all of the patches floating around in -next but I wanted to send this
> > out to let everyone know this is ready to be turned on.
> >
> > Arnd, are there many remaning -Wsometimes-uninitialized warnings in
> > randconfigs?
>
> No, I don't see any with the patches that I submitted. I haven't checked
> if there are any that still need to get merged into linux-next though.
>
> > diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
> > index 768306add591..f4332981ea85 100644
> > --- a/scripts/Makefile.extrawarn
> > +++ b/scripts/Makefile.extrawarn
> > @@ -72,5 +72,6 @@ KBUILD_CFLAGS += $(call cc-disable-warning, format)
> > KBUILD_CFLAGS += $(call cc-disable-warning, sign-compare)
> > KBUILD_CFLAGS += $(call cc-disable-warning, format-zero-length)
> > KBUILD_CFLAGS += $(call cc-disable-warning, uninitialized)
> > +KBUILD_CFLAGS += $(call cc-option, -Wsometimes-uninitialized)
> > endif
> > endif
>
> This doesn't look right. Shouldn't you remove the line that turns off
> -Wuninitilized
> instead of adding only -Wsometimes-uninitialized?
Well, there are still some outstanding issues with -Wuninitialized
right? Like with DECLARE_WAIT_QUEUE_HEAD_ONSTACK? I'd rather not
add warnings to the build but if you feel strongly, we could turn it on
then fix them after.
Nathan
>
> If we warn about the instances that may or may not be wrong, we should
> also warn about those that are provably wrong.
>
> Arnd
next prev parent reply other threads:[~2019-04-30 9:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-30 1:00 [PATCH] kbuild: Enable -Wsometimes-uninitialized Nathan Chancellor
2019-04-30 7:16 ` Arnd Bergmann
2019-04-30 9:33 ` Nathan Chancellor [this message]
2019-04-30 9:46 ` Arnd Bergmann
2019-04-30 20:54 ` Nathan Chancellor
2019-05-01 12:30 ` Masahiro Yamada
2019-05-23 1:50 ` Nathan Chancellor
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=20190430093352.GA16941@archlinux-i9 \
--to=natechancellor@gmail.com \
--cc=arnd@arndb.de \
--cc=clang-built-linux@googlegroups.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.lkml@markovi.net \
--cc=ndesaulniers@google.com \
--cc=yamada.masahiro@socionext.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