From: Tom Tromey <tom@tromey.com>
To: Pedro Alves <palves@redhat.com>
Cc: Tom Tromey <tom@tromey.com>,
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: Tue, 09 Oct 2018 19:34:00 -0000 [thread overview]
Message-ID: <878t36gbix.fsf@tromey.com> (raw)
In-Reply-To: <c6c37ac3-5ec5-d700-421a-2b01cfd281e5@redhat.com> (Pedro Alves's message of "Tue, 9 Oct 2018 11:33:39 +0100")
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
>> 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.
Pedro> Really not sure whether that is possible. I think there's hope
Pedro> that GCC value tracking becomes smart enough that these
Pedro> std::optional-related warnings end up disappearing (which usually
Pedro> means the code will optimize better too). Fingers crossed, at least.
For gdb::optional, I think it would be good enough if we could simply
suppress the warning and make operator* assert that the object was
instantiated. Perhaps std::optional could enforce this in debug mode as
well.
Tom
next prev parent reply other threads:[~2018-10-09 19:34 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
2018-10-09 10:34 ` Pedro Alves
2018-10-09 19:34 ` Tom Tromey [this message]
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=878t36gbix.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