public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] Silence maybe-uninitialized warning in dwarf2read.c
Date: Wed, 04 Dec 2019 15:34:00 -0000	[thread overview]
Message-ID: <feee869bd84841bc048b4ca60a8713d80f8be5d9@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT feee869bd84841bc048b4ca60a8713d80f8be5d9 ***

commit feee869bd84841bc048b4ca60a8713d80f8be5d9
Author:     Tom Tromey <tromey@adacore.com>
AuthorDate: Wed Dec 4 07:46:59 2019 -0700
Commit:     Tom Tromey <tromey@adacore.com>
CommitDate: Wed Dec 4 07:48:44 2019 -0700

    Silence maybe-uninitialized warning in dwarf2read.c
    
    I upgraded to Fedora 30 recently.  It includes GCC 9, which gives a
    warning for dwarf2read.c:
    
    ../../binutils-gdb/gdb/dwarf2read.c:16103:24: warning: discr_offset may be used uninitialized in this function [-Wmaybe-uninitialized]
    
    This patch fixes the problem by initializing discr_offset.
    Tested by rebuilding.
    
    gdb/ChangeLog
    2019-12-04  Tom Tromey  <tromey@adacore.com>
    
            * dwarf2read.c (process_structure_scope): Initialize
            "discr_offset".
    
    Change-Id: I76a6157921c9beacb641b8a41e10026006621b95

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index aacc0c9b16..f27043da0e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2019-12-04  Tom Tromey  <tromey@adacore.com>
+
+	* dwarf2read.c (process_structure_scope): Initialize
+	"discr_offset".
+
 2019-12-04  Andrew Burgess  <andrew.burgess@embecosm.com>
 
 	* mi/mi-symbol-cmds.c (mi_symbol_info): Take extra parameter, and
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 327837cc3c..f99061d40d 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -16060,7 +16060,7 @@ process_structure_scope (struct die_info *die, struct dwarf2_cu *cu)
      read the discriminant member, so we can record it later in the
      discriminant_info.  */
   bool is_variant_part = TYPE_FLAG_DISCRIMINATED_UNION (type);
-  sect_offset discr_offset;
+  sect_offset discr_offset {};
   bool has_template_parameters = false;
 
   if (is_variant_part)


             reply	other threads:[~2019-12-04 15:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04 15:34 gdb-buildbot [this message]
2019-12-04 15:06 ` Failures on Ubuntu-Aarch64-native-extended-gdbserver-m64, branch master gdb-buildbot
2019-12-04 15:43 ` Failures on Ubuntu-Aarch64-native-gdbserver-m64, " gdb-buildbot
2019-12-04 17:39 ` Failures on Fedora-i686, " gdb-buildbot
2019-12-04 17:40 ` Failures on Fedora-x86_64-m32, " gdb-buildbot
2019-12-04 17:42 ` Failures on Fedora-x86_64-cc-with-index, " gdb-buildbot
2019-12-04 18:05 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2019-12-04 18:16 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot
2019-12-04 18:21 ` *** COMPILATION FAILED *** Failures on Fedora-x86_64-w64-mingw32, branch master *** BREAKAGE *** gdb-buildbot
2019-12-04 18:24 ` Failures on Fedora-x86_64-native-gdbserver-m64, branch master gdb-buildbot
2019-12-04 18:34 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot

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=feee869bd84841bc048b4ca60a8713d80f8be5d9@gdb-build \
    --to=gdb-buildbot@sergiodj.net \
    --cc=gdb-testers@sourceware.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).