qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] [PATCH v2] nbd: fix uninitialized variable


From: Eric Blake
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH v2] nbd: fix uninitialized variable warning
Date: Tue, 16 Jul 2019 09:14:36 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0

On 7/16/19 5:21 AM, Philippe Mathieu-Daudé wrote:
> I was writing on your v1 "it might be worth commenting this is when
> building with -O3"
> 
> This might be as easy as having the subject modified (by maintainer
> taking this patch?) as:
> 
> "fix uninitialized variable warning [when building with -O3]"
> 

I can do a touchup (probably to the commit body, rather than the subject).


>> cc1: all warnings being treated as errors
>>
>> Reported-by: Thomas Huth <address@hidden>
>> Signed-off-by: Marc-André Lureau <address@hidden>
>> Reviewed-by: Philippe Mathieu-Daudé <address@hidden>

Thanks; will queue through my NBD tree.

>> ---
>>  block/nbd.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/block/nbd.c b/block/nbd.c
>> index 81edabbf35..0f74c1e455 100644
>> --- a/block/nbd.c
>> +++ b/block/nbd.c
>> @@ -707,7 +707,7 @@ static bool nbd_reply_chunk_iter_receive(BDRVNBDState *s,
>>                                           void **payload)
>>  {
>>      int ret, request_ret;
>> -    NBDReply local_reply;
>> +    NBDReply local_reply = {};

Relies on the gcc extension rather than the idiomatic C spelling of {0}
(but we rely on it elsewhere, in part because some versions of clang are
buggy on incorrectly warning about the idiomatic spelling, so nothing new)

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]