qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: Blue Swirl <blauwirbel@gmail.com>,
	Stefan Hajnoczi <stefanha@gmail.com>,
	qemu-trivial@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] net/socket: Fix compiler warning (regression for MinGW)
Date: Sat, 22 Sep 2012 20:17:56 +0200	[thread overview]
Message-ID: <505E00D4.7040104@weilnetz.de> (raw)
In-Reply-To: <505DFCFD.6010202@msgid.tls.msk.ru>

Am 22.09.2012 20:01, schrieb Michael Tokarev:
> 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

Thanks for the hint.

I already sent v2 of my patch (with a comment as suggested by Stefan H.).

Of course we could also add a qemu_sendto to qemu-common.h.
Is there anybody who would prefer that solution?

Regards
Stefan W.

  reply	other threads:[~2012-09-22 18:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-20 19:32 [Qemu-devel] [PATCH] net/socket: Fix compiler warning (regression for MinGW) Stefan Weil
2012-09-22 16:32 ` Stefan Hajnoczi
2012-09-22 18:01   ` Michael Tokarev
2012-09-22 18:17     ` Stefan Weil [this message]
2012-09-22 18:25       ` Blue Swirl
  -- strict thread matches above, loose matches on Subject: below --
2012-09-22 19:13 Stefan Weil
2012-09-23  6:37 ` Stefan Hajnoczi

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=505E00D4.7040104@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=blauwirbel@gmail.com \
    --cc=mjt@tls.msk.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=stefanha@gmail.com \
    /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).