From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1T4Grx-0006mJ-8Y for mharc-qemu-trivial@gnu.org; Wed, 22 Aug 2012 15:45:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4Gru-0006fd-Hd for qemu-trivial@nongnu.org; Wed, 22 Aug 2012 15:45:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T4Grt-0000a5-Eu for qemu-trivial@nongnu.org; Wed, 22 Aug 2012 15:45:34 -0400 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:43271) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4Grt-0000Zs-9Q for qemu-trivial@nongnu.org; Wed, 22 Aug 2012 15:45:33 -0400 Received: from localhost (v220110690675601.yourvserver.net.local [127.0.0.1]) by v220110690675601.yourvserver.net (Postfix) with ESMTP id A6344728002B; Wed, 22 Aug 2012 21:45:32 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at weilnetz.de Received: from v220110690675601.yourvserver.net ([127.0.0.1]) by localhost (v220110690675601.yourvserver.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lfYYF2L8s9wi; Wed, 22 Aug 2012 21:45:32 +0200 (CEST) Received: from flocke.weilnetz.de (p5086EC12.dip.t-dialin.net [80.134.236.18]) by v220110690675601.yourvserver.net (Postfix) with ESMTPSA id 37C6A7280028; Wed, 22 Aug 2012 21:45:32 +0200 (CEST) Received: from localhost ([127.0.0.1] ident=stefan) by flocke.weilnetz.de with esmtp (Exim 4.72) (envelope-from ) id 1T4Grr-000806-OP; Wed, 22 Aug 2012 21:45:31 +0200 Message-ID: <503536DB.5060603@weilnetz.de> Date: Wed, 22 Aug 2012 21:45:31 +0200 From: Stefan Weil User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20120724 Iceowl/1.0b1 Icedove/3.0.11 MIME-Version: 1.0 To: qemu-trivial References: <1345664451-28890-1-git-send-email-sw@weilnetz.de> In-Reply-To: <1345664451-28890-1-git-send-email-sw@weilnetz.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 78.47.199.172 Cc: Blue Swirl Subject: Re: [Qemu-trivial] [PATCH] w32: Always use standard instead of native format strings X-BeenThere: qemu-trivial@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Aug 2012 19:45:36 -0000 Am 22.08.2012 21:40, schrieb Stefan Weil: > GLib 2.0 include files use __printf__ for the format attribute > which resolves to native format strings on w32 hosts. > > QEMU wants standard format strings instead of native format > strings, so we simply change any declaration with __printf__ > to use __gnu_printf__. > > This works because all basic printf functions support both > kinds of format strings. > > This fixes a compiler warning: > > qapi/string-output-visitor.c: In function =E2=80=98print_type_int=E2=80= =99: > qapi/string-output-visitor.c:34:5: warning: unknown conversion type=20 > character =E2=80=98l=E2=80=99 in format [-Wformat] > qapi/string-output-visitor.c:34:5: warning: too many arguments for=20 > format [-Wformat-extra-args] > > Signed-off-by: Stefan Weil > --- > compiler.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/compiler.h b/compiler.h > index 07ba1f8..c734a71 100644 > --- a/compiler.h > +++ b/compiler.h > @@ -44,6 +44,11 @@ > /* Use gnu_printf when supported (qemu uses standard format strings). *= / > # define GCC_ATTR __attribute__((__unused__, format(gnu_printf, 1, 2))) > # define GCC_FMT_ATTR(n, m) __attribute__((format(gnu_printf, n, m))) > +# if defined(_WIN32) > + /* Map __printf__ to __gnu_printf__ because we want standard format=20 > strings > + * even when MinGW or GLib include files use __printf__. */ > +# define __printf__ __gnu_printf__ > +# endif > # endif > #if defined(_WIN32) > #define GCC_WEAK __attribute__((weak)) Sorry, I used the wrong mail address. The mail should go to qemu-devel, not to qemu-trivial. Of course I don't mind if it is applied via qemu-trivial. Cheers, Stefan W.