This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Re: [PATCH 3/3] Simplify event-loop core, remove two-step event processing
- From: Alex Velenko <Alex dot Velenko at arm dot com>
- To: Patrick Palka <patrick at parcs dot ath dot cx>, Pedro Alves <palves at redhat dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Wed, 04 Feb 2015 17:34:42 +0000
- Subject: Re: Re: [PATCH 3/3] Simplify event-loop core, remove two-step event processing
- Authentication-results: sourceware.org; auth=none
- References: <1422292759-22307-1-git-send-email-palves at redhat dot com> <1422292759-22307-4-git-send-email-palves at redhat dot com> <CA+C-WL_S7MTCb5rLWbpkMbR0JMQvH98mrWD-sZ50erNhVkN6JQ at mail dot gmail dot 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