From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41277) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGEKr-0005AM-Bt for qemu-devel@nongnu.org; Mon, 24 Sep 2012 15:28:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGEKp-0002J7-Sb for qemu-devel@nongnu.org; Mon, 24 Sep 2012 15:28:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25537) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGEKp-0002J1-K2 for qemu-devel@nongnu.org; Mon, 24 Sep 2012 15:28:51 -0400 Message-ID: <5060B46F.8060400@redhat.com> Date: Mon, 24 Sep 2012 13:28:47 -0600 From: Eric Blake MIME-Version: 1.0 References: <1345664552-2250-1-git-send-email-sw@weilnetz.de> In-Reply-To: <1345664552-2250-1-git-send-email-sw@weilnetz.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig9C3308CB4E5C2DA3333DA3B0" Subject: Re: [Qemu-devel] [PATCH] w32: Always use standard instead of native format strings List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: Blue Swirl , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig9C3308CB4E5C2DA3333DA3B0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 08/22/2012 01:42 PM, Stefan Weil wrote: > GLib 2.0 include files use __printf__ for the format attribute > which resolves to native format strings on w32 hosts. >=20 > QEMU wants standard format strings instead of native format > strings, so we simply change any declaration with __printf__ > to use __gnu_printf__. >=20 > This works because all basic printf functions support both > kinds of format strings. >=20 > This fixes a compiler warning: >=20 > 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 cha= racter =E2=80=98l=E2=80=99 in format [-Wformat] > qapi/string-output-visitor.c:34:5: warning: too many arguments for form= at [-Wformat-extra-args] >=20 > Signed-off-by: Stefan Weil > --- > compiler.h | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > 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 forma= t strings > + * even when MinGW or GLib include files use __printf__. */ > +# define __printf__ __gnu_printf__ > +# endif Don't you need to make this conditional on the gcc version? That is, gcc 4.4 added __gnu_printf__, but gcc 4.3 understands only __printf__ and attempts to pass __gnu_printf__ will cause compilation failure. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig9C3308CB4E5C2DA3333DA3B0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iQEcBAEBCAAGBQJQYLRwAAoJEKeha0olJ0NqPscH/RYh65YrdFOT36eaCsKrR5k+ ju6lQuI3XbnMw2MXuq8IhKzsY5dW6nlulKYXpH7mj7xsgWjqkBGBD06SumPw//Sb Bh1+/RoNiVLdLwG/yx5bBfYJIECc4ahOcf8RKy1xPok2x4bMzqZYJRo6K4jKBsfT zovRrzpadMFeoe+g93G9F9a4G6TRoLIDqn4kMvmwe4BDqBDQifdH6BZ+q0/LlwFe Xq/zvKUaLBN/gWq/xd9ZKQ9YFwRzbj4rV3L5ktGvkRT5Dk+XK4nNoyiAQi1a2YBH TLE9vAp59I0ERsed/tvABCADEa+kKS9SFltQkq/k8AH+561PfJDVyoBmsokjjCo= =WHJZ -----END PGP SIGNATURE----- --------------enig9C3308CB4E5C2DA3333DA3B0--