From: Mark Wielaard <mjw@redhat.com>
To: Alexander Klimov <alserkli@inbox.ru>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Work-around for a bug in GCC5.
Date: Wed, 28 Jan 2015 12:01:00 -0000 [thread overview]
Message-ID: <20150127213120.GD12565@blokker.redhat.com> (raw)
In-Reply-To: <TheMailAgent.7a67d083@6dc232f2>
On Tue, Jan 27, 2015 at 08:14:39PM +0200, Alexander Klimov wrote:
> 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.
Thanks for reducing it to something simpler! I was somewhat embarrassed
I couldn't find a simpler case that showed the issue. I had a different
fix, but I couldn't figure out why it was necessary:
https://sourceware.org/ml/gdb-patches/2015-01/msg00665.html
Your fix is simpler and it is more clear why it is a real workaround.
I think my fix is technically more correct since it makes the code
and error emmitted in this case more like the other commands (although
it isn't clear if that really matters, it is still an error case). But it
isn't immediately clear why it is a good workaround for this GCC5 issue.
What do others think? Could someone approve either of the fixes?
Getting a fix in to make GDB compile with GCC5 would be really welcome.
Thanks,
Mark
next prev parent reply other threads:[~2015-01-27 21:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-27 19:35 Alexander Klimov
2015-01-28 12:01 ` Mark Wielaard [this message]
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=20150127213120.GD12565@blokker.redhat.com \
--to=mjw@redhat.com \
--cc=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