qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] virtio-net: Fix VirtIONet typedef redefinition


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [PATCH] virtio-net: Fix VirtIONet typedef redefinition
Date: Mon, 21 Jan 2019 20:46:52 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

On 1/21/19 8:22 PM, Eric Blake wrote:
> On 1/21/19 12:10 PM, Philippe Mathieu-Daudé wrote:
>> Commit 2974e916df8 introduced the VirtioNetRscChain structure which
>> refer to a VirtIONet, declared later, thus required VirtIONet typedef
>> to be declarated forward.
> 
> s/be declarated forward/use a forward declaration/

Thanks Eric.

Thomas, do you mind fixing this if you take this patch?

>> However, when compiling with Clang in -std=gnu99 mode, this triggers
>> the following warning/error:
>>
>>     CC      hw/net/virtio-net.o
>>   In file included from qemu/hw/net/virtio-net.c:22:
>>   include/hw/virtio/virtio-net.h:189:3: error: redefinition of typedef 
>> 'VirtIONet' is a C11 feature [-Werror,-Wtypedef-redefinition]
>>   } VirtIONet;
>>     ^
>>   include/hw/virtio/virtio-net.h:110:26: note: previous definition is here
>>   typedef struct VirtIONet VirtIONet;
>>                            ^
>>   1 error generated.
>>   make: *** [rules.mak:69: hw/net/virtio-net.o] Error 1
>>
>> Fix it by removing the duplicate typedef definition.
>>
>> Reported-by: Peter Maydell <address@hidden>
>> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
>> ---
>>  include/hw/virtio/virtio-net.h | 5 ++---
>>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> Reviewed-by: Eric Blake <address@hidden>
> 

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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