public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@efficios.com>
To: Tom Tromey <tom@tromey.com>,
	Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] gdb: fix -Wmaybe-uninitialized warning in value.c
Date: Thu, 2 Mar 2023 16:03:12 -0500	[thread overview]
Message-ID: <ebf6bd4c-9d2e-bdb2-3285-86b42bf5c0ae@efficios.com> (raw)
In-Reply-To: <874jr2c1h4.fsf@tromey.com>

On 3/2/23 16:00, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Simon> This is because the union field internalvar::u is not initialized when
> Simon> constructing the temporary internalvar object above.  That object is then used
> Simon> for move-construction, and the (implicit) move constructor copies the
> Simon> uninitialized bytes of field u over from the temporary object to the new
> Simon> internalvar object.  The compiler therefore complains that we use uninitialized
> Simon> bytes.  I don't think it's really a problem, because the internalvar object is
> Simon> in the `kind == INTERNALVAR_VOID` state, in which the contents of the union is
> Simon> irrelevant.  Still, mute the warning by default-initializing the union.
> 
> Seems fine to me.
> Reviewed-By: Tom Tromey <tom@tromey.com>
> 
> Tom

Pushed, thanks.

Simon

      reply	other threads:[~2023-03-02 21:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-02 20:26 Simon Marchi
2023-03-02 21:00 ` Tom Tromey
2023-03-02 21:03   ` Simon Marchi [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=ebf6bd4c-9d2e-bdb2-3285-86b42bf5c0ae@efficios.com \
    --to=simon.marchi@efficios.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.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).