From: Andrey Ryabinin <aryabinin@virtuozzo.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: <fengguang.wu@intel.com>, <linux-kernel@vger.kernel.org>,
<kbuild-all@01.org>
Subject: Re: [PATCH] ubsan: fix tree-wide -Wmaybe-uninitialized false positives
Date: Tue, 26 Jan 2016 20:03:24 +0300 [thread overview]
Message-ID: <56A7A6DC.1010605@virtuozzo.com> (raw)
In-Reply-To: <20160125134136.cee4919a8453c4753f177c3b@linux-foundation.org>
On 01/26/2016 12:41 AM, Andrew Morton wrote:
> On Mon, 25 Jan 2016 19:01:34 +0300 Andrey Ryabinin <aryabinin@virtuozzo.com> wrote:
>
>> -fsanitize=* options makes GCC less smart than usual and increase number
>> of 'maybe-uninitialized' false-positives. So this patch does two things:
>> * Add -Wno-maybe-uninitialized to CFLAGS_UBSAN which will disable all
>> such warnings for instrumented files.
>> * Remove CONFIG_UBSAN_SANITIZE_ALL from all[yes|mod]config builds. So
>> the all[yes|mod]config build goes without -fsanitize=* and still with
>> -Wmaybe-uninitialized.
>
> hm, that's a bit sad.
>
> We have no means of working out whether we should re-enable
> maybe-uninitialized for later gcc's, as they become smarter about this.
> What do we do, just "remember" to try it later on?
>
I don't see anything bad about it. Note, that CONFIG_UBSAN_SANITIZE_ALL=y *only* adds
-fsanitize=* to CFLAGS and this patch removes only CONFIG_UBSAN_SANITIZE_ALL from allyesconfig, but not the CONFIG_UBSAN.
So now, we do allyesconfig build without CONFIG_UBSAN_SANITIZE_ALL (iow without -fsantize=*), but still with CONFIG_UBSAN=y.
Which means that we still build lib/ubsan.c (and with -Wmaybe-uninitialized).
> Do you know if this issue is on the gcc developer' radar?
>
I don't know, but it's unlikely that something will be changed here. -Wmaybe-uninitialized will always be prone to
false-positives, simply by definition of it(if GCC could prove that variable is uninitialized it will issue another
warning -Wuninitialized). And since -fsanitize=* causes significant changes in generated code, the influence on
-Wmaybe-uninitialized likely will retain.
prev parent reply other threads:[~2016-01-26 17:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-25 7:15 sound/soc/codecs/wm8962.c:2790:32: warning: 'fratio' may be used uninitialized in this function kbuild test robot
2016-01-25 16:01 ` [PATCH] ubsan: fix tree-wide -Wmaybe-uninitialized false positives Andrey Ryabinin
2016-01-25 21:41 ` Andrew Morton
2016-01-26 17:03 ` Andrey Ryabinin [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=56A7A6DC.1010605@virtuozzo.com \
--to=aryabinin@virtuozzo.com \
--cc=akpm@linux-foundation.org \
--cc=fengguang.wu@intel.com \
--cc=kbuild-all@01.org \
--cc=linux-kernel@vger.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
Powered by JetHome