public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Xinliang David Li <davidxl@google.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: new option -Wno-maybe-uninitialized
Date: Thu, 21 Apr 2011 17:40:00 -0000	[thread overview]
Message-ID: <4DB0679C.9050100@redhat.com> (raw)
In-Reply-To: <BANLkTinrN6vuDmj-0_cfmi5_QC69fXFUDA@mail.gmail.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/07/11 18:24, Xinliang David Li wrote:
> Hi,
> 
> the following patch implements the option to fine control the emitted
> warnings --
> 1) allow suppressing warnings for use of values that may be
> uninitialized.  Definitely uninitialized values that may be used
> warning is not affected
> 2) allow fine grain control on promotion of warnings to errors:
> -Wno-error=maybe-uninitialized
> 
> This is useful for users who only care about definite uninitialized
> variable warnings.
I'm definitely in favor of having the ability for the user to be able to
fine tune the warnings they want.  However, I have some concerns.

First, I'm not sure how reconcile the may vs must inconsistency.  We can
have an object which is used in a real statement in the IL, which we
currently would classify as must-be-uninitialized, even if the path
leading to the statement is unexecutable.    I guess I want to find
better ways to describe this kind of stuff in our documentation and
switch names

Second, I'm concerned about changing the default behaviour of
- -Wuninitialized.  I don't think we ever reached a consensus on that
issue last time we tried to hash through this stuff.  Maybe I missed
something, but it appears to me your patch makes -Wuninitialized only
warn about real uses and ignore uses in PHIs.

Given the lack of consensus (and I believe there will never be a
consensus), I believe we should keep -Wuninitialized behavior as-is and
use -Wno-maybe-uninitialized to override -Wuninitialized.

If we can come up with better switch name than -Wno-maybe-uninitialized,
that would be a good step as well.  However, I'm not offhand sure what
name to use given the issues surrounding may vs must be used uninitialized.

jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNsGecAAoJEBRtltQi2kC7BugH/01X2ppdVUONq2fBzztxF+YR
Qn85yccwI45iizNG1dlmyZlYpATYcfTGwDkBYTjiVllhOJa64Ri6bIP3ErySPllk
OrSAbwFT96TK9/h1eGfVj45mZS3MO0Pa+sxp93noGnxIMWWOt+7LiyrfJEHHLaUK
rPhREXodzLnN0KpXTD8+RS2uzTV+YODAuiWQDkiyQ0XpjCw5w2ccc7dWnrzgvEn5
6x/baTqQxunV8t3/ezUlHiMcUNyMigXccFgIeRRsvMengY/reLxy7eg1i+vdeets
DyWR/Hg3HewLAQidL3SAJLLGuqTrNUZ0wswgqghqh9VllAFoUdKn0xk8GFt0wbk=
=4aA4
-----END PGP SIGNATURE-----

  reply	other threads:[~2011-04-21 17:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-08  0:24 Xinliang David Li
2011-04-21 17:40 ` Jeff Law [this message]
2011-04-21 19:15   ` Xinliang David Li
2011-04-22 10:34     ` Richard Guenther
2011-04-22 17:11       ` Xinliang David Li
2011-04-22 17:19       ` Gabriel Dos Reis
2011-04-22 18:12         ` Xinliang David Li
2011-04-25 22:24     ` Jeff Law

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=4DB0679C.9050100@redhat.com \
    --to=law@redhat.com \
    --cc=davidxl@google.com \
    --cc=gcc-patches@gcc.gnu.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 read-only IMAP folder(s) and NNTP newsgroup(s).