[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [Qemu-devel] [PATCH] net/socket: Fix compiler warning
From: |
Michael Tokarev |
Subject: |
Re: [Qemu-trivial] [Qemu-devel] [PATCH] net/socket: Fix compiler warning (regression for MinGW) |
Date: |
Sat, 22 Sep 2012 22:01:33 +0400 |
User-agent: |
Mozilla/5.0 (X11; Linux i686 on x86_64; rv:10.0.6esrpre) Gecko/20120817 Icedove/10.0.6 |
On 22.09.2012 20:32, Stefan Hajnoczi wrote:
> On Thu, Sep 20, 2012 at 09:32:19PM +0200, Stefan Weil wrote:
>> Add a type cast which was removed by commit
>> 213fd5087e2e4e2da10ad266df0ba950cf7618bf again.
>>
>> Without it, MinGW compilers complain:
>>
>> net/socket.c:136: warning:
>> pointer targets in passing argument 2 of ‘sendto’ differ in signedness
>> /usr/lib/gcc/amd64-mingw32msvc/4.4.4/../../../../amd64-mingw32msvc/include/winsock2.h:1313:
>> note:
>> expected ‘const char *’ but argument is of type ‘const uint8_t *’
>
> Wow, that's messed up. sendto() is POSIX and the prototype shouldn't be
> const char *.
>
> It's easy for someone to remove this cast in the future. Please add a
> comment explaining that it's needed because MinGW headers don't have the
> POSIX version of sendto().
There's qemu_recv() in qemu-common.h, for exactly the same purpose.
But qemu_recv() is much more evil, IMHO.
Thanks,
/mjt