public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Alex Velenko <Alex.Velenko@arm.com>
To: Patrick Palka <patrick@parcs.ath.cx>, Pedro Alves <palves@redhat.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: Re: [PATCH 3/3] Simplify event-loop core, remove two-step event processing
Date: Wed, 04 Feb 2015 17:34:00 -0000	[thread overview]
Message-ID: <54D25832.1010007@arm.com> (raw)
In-Reply-To: <CA+C-WL_S7MTCb5rLWbpkMbR0JMQvH98mrWD-sZ50erNhVkN6JQ@mail.gmail.com>

On 03/02/15 22:48, Patrick Palka wrote:
> This patch causes a build failure when compiling GDB with GCC 4.9:
>
> /home/patrick/code/binutils-gdb/gdb/event-loop.c: In function
> ‘gdb_do_one_event’:
> /home/patrick/code/binutils-gdb/gdb/event-loop.c:296:10: error: ‘res’
> may be used uninitialized in this function
> [-Werror=maybe-uninitialized]
>         if (res > 0)
>            ^
>

Hi,
Event-loop.c "gdb_do_one_event" function did not initialize variable "res".
This caused gdb_binutils to fail building. This patch fixes it.

Builds with this patch, does not build without it.

Is patch ok? If ok, could you, please, commit (I can't)?

Kind regards,
Alex

gdb/

2015-02-04  Alex Velenko  <Alex.Velenko@arm.com>

   * event-loop.c (gdb_do_one_event): variable "res" initialized.
---
  gdb/event-loop.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/event-loop.c b/gdb/event-loop.c
index 7425b3a..1e2dc45 100644
--- a/gdb/event-loop.c
+++ b/gdb/event-loop.c
@@ -270,7 +270,7 @@ gdb_do_one_event (void)
       round-robin fashion.  */
    for (current = 0; current < number_of_sources; current++)
      {
-      int res;
+      int res = 0;

        switch (event_source_head)
  	{
-- 
1.8.1.2


  parent reply	other threads:[~2015-02-04 17:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-26 17:32 [PATCH 0/3] Fix racy FAILs of sigall-reverse.exp (and more) Pedro Alves
2015-01-26 17:19 ` [PATCH 2/3] When disabling target async, remove all target event sources from the event loop Pedro Alves
2015-01-26 17:46 ` [PATCH 1/3] Fix up some target is-async vs can-async confusions Pedro Alves
2015-01-26 19:16 ` [PATCH 3/3] Simplify event-loop core, remove two-step event processing Pedro Alves
2015-02-03 22:48   ` Patrick Palka
2015-02-04 10:51     ` Pedro Alves
2015-02-04 17:34     ` Alex Velenko [this message]
2015-02-04 18:18       ` Pedro Alves
2015-02-04  9:49   ` Sergio Durigan Junior
2015-02-03 15:27 ` [PATCH 0/3] Fix racy FAILs of sigall-reverse.exp (and more) Pedro Alves

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=54D25832.1010007@arm.com \
    --to=alex.velenko@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=patrick@parcs.ath.cx \
    /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).