From: Stefan Weil <weil@mail.berlios.de>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: "Andreas Färber" <andreas.faerber@web.de>,
"QEMU Developers" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 3/3] w32: Fix format string regression
Date: Sun, 17 Jul 2011 20:34:39 +0200 [thread overview]
Message-ID: <4E232B3F.9020108@mail.berlios.de> (raw)
In-Reply-To: <CAAu8pHtmtUOkn7VTxXsktWhSQu5YjQ9B3Js1qGuGSk9HC_ZOTQ@mail.gmail.com>
Am 17.07.2011 11:03, schrieb Blue Swirl:
> On Fri, Jul 15, 2011 at 11:42 PM, Andreas Färber
> <andreas.faerber@web.de> wrote:
>> Am 15.07.2011 um 21:38 schrieb Stefan Weil:
>>> Commit 953ffe0f935f40c0d6061d69e76e0339393b54f8
>>> introduced FMT_pid which is wrong for w32 and w64 getpid():
>>> those getpid() implementations always return an int value.
>
> This is not in line with Posix:
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/getpid.html#tag_16_243
Maybe I should have added that getpid() is a function in a vendor
specific API.
Microsoft does not claim that getpid() is in line with Posix
(they say it is a deprecated POSIX function, see
http://msdn.microsoft.com/en-us/library/ms235372%28v=vs.80%29.aspx).
Visual Studio uses this declaration:
_CRT_NONSTDC_DEPRECATE(_getpid) _CRTIMP int __cdecl getpid(void);
Mingw32 tries to be more POSIX like and uses (with pid_t = int) this
declaration:
_CRTIMP pid_t __cdecl __MINGW_NOTHROW getpid (void);
Mingw-w64 is closer to the VS declaration:
int __cdecl getpid(void) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
The replacement for getpid() is _getpid(). It also has a wrong
declaration in mingw32. A patch which simply replaces getpid by
_getpid is on my todo list, but not urgent, because the current
code works when my patch was applied.
Regards,
Stefan
next prev parent reply other threads:[~2011-07-17 18:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-15 19:38 [Qemu-devel] New patches for w32, w64 Stefan Weil
2011-07-15 19:38 ` [Qemu-devel] [PATCH 1/3] Fix conversions from pointer to tcg_target_long Stefan Weil
2011-07-18 3:19 ` Guan Xuetao
2011-07-18 7:39 ` Alexander Graf
2011-07-15 19:38 ` [Qemu-devel] [PATCH 2/3] w64: Add definition of FMT_pid Stefan Weil
2011-07-15 20:39 ` Andreas Färber
2011-07-15 19:38 ` [Qemu-devel] [PATCH 3/3] w32: Fix format string regression Stefan Weil
2011-07-15 20:42 ` Andreas Färber
2011-07-17 9:03 ` Blue Swirl
2011-07-17 18:34 ` Stefan Weil [this message]
2011-07-17 21:31 ` Blue Swirl
2011-08-13 9:38 ` [Qemu-devel] New patches for w32, w64 Stefan Weil
2011-08-13 10:49 ` Blue Swirl
2011-08-21 16:40 ` Blue Swirl
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=4E232B3F.9020108@mail.berlios.de \
--to=weil@mail.berlios.de \
--cc=andreas.faerber@web.de \
--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).