public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Sebor <msebor@gmail.com>
To: Jonathan Wakely <jwakely@redhat.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Improve -Wmaybe-uninitialized documentation
Date: Thu, 16 Nov 2017 05:32:00 -0000	[thread overview]
Message-ID: <89b7f6cb-4fba-d43a-6542-74c418e40e6b@gmail.com> (raw)
In-Reply-To: <20171115143140.GA4279@redhat.com>

On 11/15/2017 07:31 AM, Jonathan Wakely wrote:
> The docs for -Wmaybe-uninitialized have some issues:
>
> - That first sentence is looooooong.
> - Apparently some C++ programmers think "automatic variable" means one
>  declared with C++11 `auto`, rather than simply a local variable.
> - The sentence about only warning when optimizing is stuck in between
>  two chunks talking about longjmp, which could be inferred to mean
>  only the setjmp/longjmp part of the warning depends on optimization.
>
> This attempts to make it easier to parse and understand.

I've always found the description remarkably precise.  Particularly
the bit where it talks about the two paths, one initialized and the
other not.  Your rewording loses that distinction so I don't think
it's as accurate, or even correct.

To use an example, this would satisfy the new description:

   int f (void)
   {
     int i;
     return i;
   }

but it doesn't match GCC behavior (it triggers -Wuninitialized,
not -Wmaybe-uninitialized).  Unless the distinction is more
subtle than I ascribe to it I think it needs to be preserved
in the rewording.

Martin

  reply	other threads:[~2017-11-16  3:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-15 15:00 Jonathan Wakely
2017-11-16  5:32 ` Martin Sebor [this message]
2017-11-16 10:57   ` Jonathan Wakely
2017-11-16 16:22     ` Martin Sebor
2017-11-17 12:56       ` Jonathan Wakely
2017-11-17 17:30         ` Jeff Law
2017-11-16 18:12     ` Jeff Law
2017-11-17 12:44       ` Jonathan Wakely

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=89b7f6cb-4fba-d43a-6542-74c418e40e6b@gmail.com \
    --to=msebor@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely@redhat.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 read-only IMAP folder(s) and NNTP newsgroup(s).