Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: gdb-patches@sourceware.org, Joel Brobecker <brobecker@adacore.com>
Subject: Re: GDB 11.0.90 available for testing
Date: Sun, 11 Jul 2021 07:01:34 -0700	[thread overview]
Message-ID: <20210711140134.GA634772@adacore.com> (raw)
In-Reply-To: <5f0c8991-fbcc-1cf9-119f-3b4195f32bea@polymtl.ca>

[-- Attachment #1: Type: text/plain, Size: 862 bytes --]

> > 1. A compilation warning in Gnulib's select.c -- reported to the
> > Gnulib folks.
> > 
> > 2. A compilation warning in symtab.c:
> > 
> >        CXX    symtab.o
> >      symtab.c: In member function 'bool info_sources_filter::matches(const char*) const':
> >      symtab.c:4247:28: warning: 'to_match' may be used uninitialized in this function [-Wmaybe-uninitialized]
> >       4247 |       if (m_c_regexp->exec (to_match, 0, NULL, 0) != 0)
> > 	   |           ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
> > 
> > I guess we need a 'default:' case there?  Or maybe initialize
> > 'to_match' with some suitable value?
> 
> See:
> 
> https://sourceware.org/pipermail/gdb-patches/2021-July/180689.html
> 
> So it would be worth pushing that patch to the release branch.

Thanks for pointing towards the patch, Simon.

Patch pushed to the gdb-11-branch.

-- 
Joel

[-- Attachment #2: 0001-Fix-warning-in-symtab.c.patch --]
[-- Type: text/x-diff, Size: 1595 bytes --]

From 2814ff838841c24a71b5cfbb982785fc95d424f8 Mon Sep 17 00:00:00 2001
From: Tom Tromey <tom@tromey.com>
Date: Sun, 11 Jul 2021 06:59:33 -0700
Subject: [PATCH] Fix warning in symtab.c

The compiler gives this warning when building symtab.c:

../../binutils-gdb/gdb/symtab.c:4247:28: warning: 'to_match' may be used uninitialized in this function [-Wmaybe-uninitialized]

This patch fixes the warning by adding a gdb_assert_not_reached.

gdb/ChangeLog:

        * gdb/symtab.c (info_sources_filter::matches): Add default
        case hander in switch statement.

(cherry picked from commit b6aeb717a8bdaa9cc348ec88a5fdf059e1337580)
---
 gdb/ChangeLog | 6 ++++++
 gdb/symtab.c  | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f37f61de030..087796b8b19 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2021-07-11  Tom Tromey  <tom@tromey.com>
+
+	Committed by Joel Brobecker  <brobecker@adacore.com>:
+	* gdb/symtab.c (info_sources_filter::matches): Add default
+	case hander in switch statement.
+
 2021-07-08  Simon Marchi  <simon.marchi@polymtl.ca>
 
 	* s390-linux-tdep.c (s390_linux_init_abi_any): Pass 1 (number
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 6a9c3dce6af..fa3f42207ec 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -4242,6 +4242,8 @@ info_sources_filter::matches (const char *fullname) const
         case match_on::FULLNAME:
           to_match = fullname;
           break;
+	default:
+	  gdb_assert_not_reached ("bad m_match_type");
         }
 
       if (m_c_regexp->exec (to_match, 0, NULL, 0) != 0)
-- 
2.25.1


      parent reply	other threads:[~2021-07-11 14:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-03 18:48 Joel Brobecker
2021-07-08 16:39 ` Eli Zaretskii via Gdb-patches
2021-07-08 16:56   ` Simon Marchi via Gdb-patches
2021-07-08 19:03     ` Eli Zaretskii via Gdb-patches
2021-07-11 14:01     ` Joel Brobecker [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=20210711140134.GA634772@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --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