public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Pedro Alves <palves@redhat.com>
Cc: Simon Marchi <simon.marchi@polymtl.ca>,
	 asmwarrior <asmwarrior@gmail.com>,
	 GDB Development <gdb@sourceware.org>
Subject: Re: gcc warning with "some variable may be used uninitialized in this function [-Wmaybe-uninitialized]" when building under msys
Date: Fri, 05 Oct 2018 05:08:00 -0000	[thread overview]
Message-ID: <87d0spf0au.fsf@tromey.com> (raw)
In-Reply-To: <8305e255-1621-96a7-cf06-3cd1cd27ceae@redhat.com> (Pedro Alves's	message of "Thu, 4 Oct 2018 13:39:55 +0100")

>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro> If the warnings confuse people too much, I'd be OK with
Pedro> disabling -Wmaybe-uninitlized completely.  I left it as a
Pedro> -Wno-error warning because even though it produces false positives,
Pedro> it also helps catch bugs earlier in the compile-edit cycle,
Pedro> when you're hacking some code, when you're introducing
Pedro> uninitialized uses, and "make" ends up compiling just a few
Pedro> files.

It caught a bug in the -Wshadow=local series; and I think in most cases
the false reports are easily handled with an initialization.  I suppose
in theory these initializations could themselves mask bugs, but I don't
recall that ever actually happening (or at least being noticed).

It would be good if gcc could recognize std::optional and not issue the
warning when it is used.  Perhaps gdb could then just always use
optional for the maybe-not-initialized cases.

Tom

  reply	other threads:[~2018-10-05  5:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-04  6:28 asmwarrior
2018-10-04 12:01 ` Simon Marchi
2018-10-04 12:40   ` Pedro Alves
2018-10-05  5:08     ` Tom Tromey [this message]
2018-10-09 10:34       ` Pedro Alves
2018-10-09 19:34         ` Tom Tromey
2018-10-09 19:54           ` Pedro Alves
2018-10-09 20:01             ` Pedro Alves
2018-10-09 20:04             ` Tom Tromey
2018-10-04 12:41   ` Tom Tromey

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=87d0spf0au.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=asmwarrior@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=palves@redhat.com \
    --cc=simon.marchi@polymtl.ca \
    /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).