From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=32931 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjxVb-0000Ou-J4 for qemu-devel@nongnu.org; Mon, 31 Jan 2011 12:25:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PjxVV-0002D6-4M for qemu-devel@nongnu.org; Mon, 31 Jan 2011 12:25:47 -0500 Received: from moutng.kundenserver.de ([212.227.17.9]:64045) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PjxVU-0002Ci-PK for qemu-devel@nongnu.org; Mon, 31 Jan 2011 12:25:41 -0500 Message-ID: <4D46F090.1040407@mail.berlios.de> Date: Mon, 31 Jan 2011 18:25:36 +0100 From: Stefan Weil MIME-Version: 1.0 References: <1291491689-11982-1-git-send-email-weil@mail.berlios.de> <4D45D7C6.70706@mail.berlios.de> <4D45DD13.2030303@mail.berlios.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] mingw32: Fix definitions for PRId64, PRIx64, PRIu64, PRIo64 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: QEMU Developers Am 30.01.2011 23:14, schrieb Blue Swirl: > On Sun, Jan 30, 2011 at 9:50 PM, Stefan Weil wrote: >> Am 30.01.2011 22:39, schrieb Blue Swirl: >>> It would appear to suppress quite a few warnings about formats. But on >>> my version of inttypes.h there is the following comment: >>> /* 7.8.1 Macros for format specifiers >>> * >>> * MS runtime does not yet understand C9x standard "ll" >>> * length specifier. It appears to treat "ll" as "l". >>> * The non-standard I64 length specifier causes warning in GCC, >>> * but understood by MS runtime functions. >>> */ >>> So is this change OK after all? >> >> Yes, it is. MS runtime indeed does not understand "%lld" >> and similar format specifiers. >> >> Mingw does, because it replaces the printf family functions >> by inline functions which call __mingw_vfprintf as soon >> as __USE_MINGW_ANSI_STDIO is defined. If your MinGW stdio.h >> does not use __USE_MINGW_ANSI_STDIO, it is too old. > > Well, mine doesn't. The change was introduced in mingw-runtime 3.15, > which was released in September 2008, but Debian still hasn't updated > from 3.13. Maybe other distros are not so lagging and someone who > wishes to build QEMU on Windows is not pampered with distro support > for MinGW anyway. Perhaps a configure time check should be added? >> QEMU defines __USE_MINGW_ANSI_STDIO, and __mingw_vfprintf >> understands C9x standard length specifiers. > > BTW, MinGW FAQ page http://www.mingw.org/wiki/FAQ still mentions that > %ll formats are not supported. The FAQ says "You should use %I64 instead of %ll when using msvcrt". => If you don't use msvcrt for printf, you no longer have to use %I64. Even with latest versions, MinGW's support for ANSI stdio is still incomplete - inttypes.h is one example, others are missing GCC atributes and missing ANSI scanf support. I'll add a page to QEMU's wiki which lists all changes needed. Regards, Stefan