From: Borislav Petkov <bp@alien8.de>
To: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Sam Ravnborg <sam@ravnborg.org>,
lkml <linux-kernel@vger.kernel.org>, Michael Matz <matz@suse.de>,
linux-kbuild@vger.kernel.org, x86-ml <x86@kernel.org>
Subject: Re: [PATCH] Kbuild: Move -Wmaybe-uninitialized to W=1
Date: Thu, 28 Jul 2016 10:46:24 +0200 [thread overview]
Message-ID: <20160728084624.GA30084@nazgul.tnic> (raw)
In-Reply-To: <20160728082915.GA2349@gmail.com>
On Thu, Jul 28, 2016 at 10:29:15AM +0200, Ingo Molnar wrote:
> BUT, isn't this the natural state of things, that the 'final' warnings
> that don't get fixed are the obnoxious, false positive ones - because
> anyone who looks at them will say "oh crap, idiotic compiler!"?
Hmm, so my experience is like Linus' - that -Wmaybe thing generates too
much noise and a lot of false positives. The thing is, as Micha (on CC)
explained it to me, that warning simply says that GCC sometimes *cannot*
know whether the variable will be used uninitialized or not and eagerly
issues the warning message, just in case.
> But over the last couple of years I think we probably had hundreds of
> bugs avoided due to the warning (both at the development and at the
> integration stage) - and
Really?
And I've yet to see an example where it actually helped :-\
> commit e01d8718de4170373cd7fbf5cf6f9cb61cebb1e9
> Author: Peter Zijlstra <peterz@infradead.org>
> Date: Wed Jan 27 23:24:29 2016 +0100
>
> perf/x86: Fix uninitialized value usage
>
> ...
>
> Only took 6 hours of painful debugging to find this. Neither GCC nor
> Smatch warnings flagged this bug.
So that warning didn't help here either.
> ... and my worry here is that we are now telling GCC: "don't you dare
> generate a false positive warning!" - at which point GCC folks will
> add even MORE heuristics to avoid false positives that generate even
> more false negatives
Why?
I think we should enable only the real warnings and turn off the stuff
which generates a lot of false positives. Or, we could put them behind
the -W= switch, so that people can still build the kernel with it but
not have them enabled by default.
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.
--
next prev parent reply other threads:[~2016-07-28 8:46 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-16 13:20 [RFC] Turn off -Wmaybe-uninitialized completely and move it to W=1 Borislav Petkov
2014-06-16 21:14 ` Sam Ravnborg
2014-06-24 21:38 ` [PATCH] Kbuild: Move -Wmaybe-uninitialized " Borislav Petkov
2014-07-07 10:53 ` Borislav Petkov
2014-07-08 9:25 ` Paul Bolle
2014-07-08 11:37 ` Borislav Petkov
2014-07-10 10:42 ` Borislav Petkov
2014-07-10 11:03 ` Paul Bolle
2016-07-28 4:20 ` Borislav Petkov
2016-07-28 8:29 ` Ingo Molnar
2016-07-28 8:46 ` Borislav Petkov [this message]
2016-07-28 16:49 ` Ingo Molnar
2016-07-28 17:04 ` Ingo Molnar
2016-07-28 17:56 ` Markus Trippelsdorf
2016-07-28 19:03 ` Linus Torvalds
2016-07-28 19:08 ` Linus Torvalds
2016-07-28 20:28 ` Ingo Molnar
2016-07-28 21:22 ` Linus Torvalds
2016-07-29 10:08 ` Arnd Bergmann
2016-07-29 10:19 ` Borislav Petkov
2016-07-29 10:35 ` Arnd Bergmann
2016-07-29 18:26 ` Linus Torvalds
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=20160728084624.GA30084@nazgul.tnic \
--to=bp@alien8.de \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matz@suse.de \
--cc=mingo@kernel.org \
--cc=sam@ravnborg.org \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.org \
/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).