qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Blue Swirl <blauwirbel@gmail.com>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 2/3] slirp: fix warning on mingw32
Date: Sun, 24 Jul 2011 08:20:37 +0200	[thread overview]
Message-ID: <4E2BB9B5.9070708@mail.berlios.de> (raw)
In-Reply-To: <4E2B49DB.6020708@codemonkey.ws>

Am 24.07.2011 00:23, schrieb Anthony Liguori:
> 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<blauwirbel@gmail.com>
>> ---
>>   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?
>
> Regards,
>
> Anthony Liguori

Microsoft's recv() takes a char *.
Both (char *)icp and (void *)icp should work here for any host.

I suggest adding a comment:
/* Type cast needed for MinGW recv. */

Regards,

Stefan Weil

  reply	other threads:[~2011-07-24  6:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-23 21:25 [Qemu-devel] [PATCH 2/3] slirp: fix warning on mingw32 Blue Swirl
2011-07-23 22:23 ` Anthony Liguori
2011-07-24  6:20   ` Stefan Weil [this message]
2011-07-24 17:21   ` Blue Swirl
2011-07-25  1:58     ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E2BB9B5.9070708@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --cc=anthony@codemonkey.ws \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).