qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/3] slirp: fix warning on mingw32


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 2/3] slirp: fix warning on mingw32
Date: Sun, 24 Jul 2011 20:58:31 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Lightning/1.0b2 Thunderbird/3.1.10

On 07/24/2011 12:21 PM, Blue Swirl wrote:
On Sun, Jul 24, 2011 at 1:23 AM, Anthony Liguori<address@hidden>  wrote:
On 07/23/2011 04:25 PM, Blue Swirl wrote:

Avoid this warning:
   CC    slirp/ip_icmp.o
/src/qemu/slirp/ip_icmp.c: In function 'icmp_receive':
/src/qemu/slirp/ip_icmp.c:418:5: error: passing argument 2 of 'recv'
from incompatible pointer type [-Werror]

/usr/local/lib/gcc/i686-mingw32msvc/4.6.0/../../../../i686-mingw32msvc/include/winsock2.h:547:32:
note: expected 'char *' but argument is of type 'struct icmp *'

Signed-off-by: Blue Swirl<address@hidden>
---
  slirp/ip_icmp.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/slirp/ip_icmp.c b/slirp/ip_icmp.c
index 14a5312..a208648 100644
--- a/slirp/ip_icmp.c
+++ b/slirp/ip_icmp.c
@@ -415,7 +415,7 @@ void icmp_receive(struct socket *so)
      icp = mtod(m, struct icmp *);

      id = icp->icmp_id;
-    len = recv(so->s, icp, m->m_len, 0);
+    len = recv(so->s, (char *)icp, m->m_len, 0);

(char *) is wrong.  recv() takes a void *.

Maybe we need to introduce a qemu_recv?

That way the casts can be eliminated though the patch is bigger.
Here's an updated patch.

Looks good:

Reviewed-by: Anthony Liguori <address@hidden>

Might be a good chance to integrate EINTR handling too. I'm sure that would fix a few lurking bugs too.

Regards,

Anthony Liguori



reply via email to

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