Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Work-around for a bug in GCC5.
@ 2015-01-27 19:35 Alexander Klimov
  2015-01-28 12:01 ` Mark Wielaard
  2015-01-29 12:43 ` Joel Brobecker
  0 siblings, 2 replies; 4+ messages in thread
From: Alexander Klimov @ 2015-01-27 19:35 UTC (permalink / raw)
  To: gdb-patches

[-- 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-02-17 10:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-27 19:35 [PATCH] Work-around for a bug in GCC5 Alexander Klimov
2015-01-28 12:01 ` Mark Wielaard
2015-01-29 12:43 ` Joel Brobecker
2015-02-17 10:18   ` Alexander Klimov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox