Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Alexander Klimov <alserkli@inbox.ru>
To: gdb-patches@sourceware.org
Subject: [PATCH] Work-around for a bug in GCC5.
Date: Tue, 27 Jan 2015 19:35:00 -0000	[thread overview]
Message-ID: <TheMailAgent.7a67d083@6dc232f2> (raw)

[-- Attachment #1: Type: TEXT/PLAIN, Size: 729 bytes --]

Compilation of (GDB) 7.9.50.20150127-cvs with (GCC) 5.0.0 20150127 
fails with

In file included from symfile.c:32:0:
symfile.c: In function 'unmap_overlay_command':
objfiles.h:628:3: error: 'sec' may be used uninitialized in this 
function [-Werror=maybe-uninitialized]
   for (osect = objfile->sections; osect < objfile->sections_end; osect++) \
   ^
symfile.c:3442:23: note: 'sec' was declared here
   struct obj_section *sec;
                       ^
cc1: all warnings being treated as errors
make[2]: *** [symfile.o] Error 1
make[2]: Leaving directory `gdb/gdb'

While the bug was reported to GCC as
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64823>,
the attached patch simply initializes sec with NULL.

-- 
Regards,
ASK

[-- Attachment #2: Type: TEXT/PLAIN, Size: 752 bytes --]

From 9ab493c21ecbd120eedf5146caf2181db7abf599 Mon Sep 17 00:00:00 2001
From: Alexander Klimov <alserkli@inbox.ru>
Date: Tue, 27 Jan 2015 19:56:45 +0200
Subject: [PATCH] Work-around for a bug in GCC5.

Reported as <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64823>
---
 gdb/symfile.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/symfile.c b/gdb/symfile.c
index d55e361..86a758a 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -3439,7 +3439,7 @@ static void
 unmap_overlay_command (char *args, int from_tty)
 {
   struct objfile *objfile;
-  struct obj_section *sec;
+  struct obj_section *sec = NULL;
 
   if (!overlay_debugging)
     error (_("Overlay debugging not enabled.  "
-- 
1.7.10.4


             reply	other threads:[~2015-01-27 18:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-27 19:35 Alexander Klimov [this message]
2015-01-28 12:01 ` Mark Wielaard
2015-01-29 12:43 ` Joel Brobecker
2015-02-17 10:18   ` Alexander Klimov

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=TheMailAgent.7a67d083@6dc232f2 \
    --to=alserkli@inbox.ru \
    --cc=gdb-patches@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