From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:50840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QiWAy-0006aZ-HN for qemu-devel@nongnu.org; Sun, 17 Jul 2011 14:34:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QiWAx-0002jM-9r for qemu-devel@nongnu.org; Sun, 17 Jul 2011 14:34:48 -0400 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:40490) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QiWAx-0002j7-1m for qemu-devel@nongnu.org; Sun, 17 Jul 2011 14:34:47 -0400 Message-ID: <4E232B3F.9020108@mail.berlios.de> Date: Sun, 17 Jul 2011 20:34:39 +0200 From: Stefan Weil MIME-Version: 1.0 References: <1310758694-6360-1-git-send-email-weil@mail.berlios.de> <1310758694-6360-4-git-send-email-weil@mail.berlios.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 3/3] w32: Fix format string regression List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= , QEMU Developers Am 17.07.2011 11:03, schrieb Blue Swirl: > On Fri, Jul 15, 2011 at 11:42 PM, Andreas F=C3=A4rber=20 > 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#t= ag_16_243 Maybe I should have added that getpid() is a function in a vendor=20 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=3Dvs.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 =3D int) this=20 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