From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:33630) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlARG-0003lI-Rf for qemu-devel@nongnu.org; Sun, 24 Jul 2011 21:58:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QlARF-0007xI-MO for qemu-devel@nongnu.org; Sun, 24 Jul 2011 21:58:34 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:43619) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlARF-0007xE-Hp for qemu-devel@nongnu.org; Sun, 24 Jul 2011 21:58:33 -0400 Received: by ywb3 with SMTP id 3so2379999ywb.4 for ; Sun, 24 Jul 2011 18:58:32 -0700 (PDT) Message-ID: <4E2CCDC7.4050203@codemonkey.ws> Date: Sun, 24 Jul 2011 20:58:31 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <4E2B49DB.6020708@codemonkey.ws> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/3] slirp: fix warning on mingw32 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel On 07/24/2011 12:21 PM, Blue Swirl wrote: > On Sun, Jul 24, 2011 at 1:23 AM, Anthony Liguori 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 >>> --- >>> 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 Might be a good chance to integrate EINTR handling too. I'm sure that would fix a few lurking bugs too. Regards, Anthony Liguori