Re: [PATCH 3/3] Simplify event-loop core, remove two-step event processing
Commit Message
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(-)
Comments
On 02/04/2015 06:34 PM, Alex Velenko wrote:
> 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.
Thanks! However, this fixed it for me:
https://sourceware.org/ml/gdb-patches/2015-02/msg00075.html
Can you make sure you have that in your tree?
Thanks,
Pedro Alves
@@ -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)
{