From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1W4Yhx-0004rz-Lt for mharc-grub-devel@gnu.org; Sat, 18 Jan 2014 11:25:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43468) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4Yhn-0004kp-QM for grub-devel@gnu.org; Sat, 18 Jan 2014 11:25:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W4Yhc-0003Li-Sm for grub-devel@gnu.org; Sat, 18 Jan 2014 11:25:07 -0500 Received: from mail-ee0-x22e.google.com ([2a00:1450:4013:c00::22e]:62508) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4Yhc-0003LO-HE for grub-devel@gnu.org; Sat, 18 Jan 2014 11:24:56 -0500 Received: by mail-ee0-f46.google.com with SMTP id c13so2551185eek.19 for ; Sat, 18 Jan 2014 08:24:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=1oOIjMYSwkSmEKwOsUtR8ttOwwATbr5J8wcSDgRh4po=; b=miSv/iQWblIlF4nCybtib7j39ZgQUx3rpUVOzEzL5gFAduuwCXi4KWittWCjp+cLfv SsI3g3HML/CowqSKmsF+wJDw8UmgSg/IljDNuoj+Ev5SycWo3RKvrdRIBU0LXWTGa1/4 T+26QUXOgmIG/xlcEGDvHSWS2Ukpbx7c7VtszQy1xXkEZco6X2qpCQnsKazgrsOQzWjM zCZQlTeX5m0HhzhhL0KYBKkKZp/YtwuB0k23o6Svb+8q1NhY2xpYoEk+1BiMkzon2123 vlnSLwZM3U1CSG4RFYFDH9+aUxt8zlCAAtRoOGoYPDrg5bx0QWG03Mn2lHaUQUCfYEhV QH6A== X-Received: by 10.14.198.195 with SMTP id v43mr3280813een.62.1390062295756; Sat, 18 Jan 2014 08:24:55 -0800 (PST) Received: from [192.168.1.16] (85-188.196-178.cust.bluewin.ch. [178.196.188.85]) by mx.google.com with ESMTPSA id o47sm36468761eem.21.2014.01.18.08.24.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 18 Jan 2014 08:24:54 -0800 (PST) Message-ID: <52DAAAD5.5000807@gmail.com> Date: Sat, 18 Jan 2014 17:24:53 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.2.0 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCH v2] fix Mingw W64-32 cross compile failure due to printf redefinition in libintl.h References: <1388253611-16848-1-git-send-email-arvidjaar@gmail.com> <1390061390-14156-1-git-send-email-arvidjaar@gmail.com> In-Reply-To: <1390061390-14156-1-git-send-email-arvidjaar@gmail.com> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="VmclCmXjMW1B6xf978m4C2gkhdrPR8Uw9" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::22e X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jan 2014 16:25:16 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --VmclCmXjMW1B6xf978m4C2gkhdrPR8Uw9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 18.01.2014 17:09, Andrey Borzenkov wrote: > In file included from util/misc.c:36:0: > ./include/grub/emu/misc.h:56:1: error: 'libintl_printf' is an unrecogni= zed format function type [-Werror=3Dformat=3D] > char * EXPORT_FUNC(xasprintf) (const char *fmt, ...) __attribute__ ((f= ormat (printf, 1, 2))) WARN_UNUSED_RESULT; > ^ > ./include/grub/emu/misc.h:58:1: error: 'libintl_printf' is an unrecogni= zed format function type [-Werror=3Dformat=3D] >=20 > The reason is libintl.h which redefines printf as libintl_printf. The p= roblem > is not present in native MinGW build which avoids redefinition. Use > (format (__printf__) instead which is valid replacement in GCC. >=20 > v2: add grub-core/lib/libgcrypt/src/g10lib.h >=20 can we avoid modifying libgcrypt? > --- > grub-core/lib/libgcrypt/src/g10lib.h | 4 ++-- > include/grub/crypto.h | 2 +- > include/grub/emu/misc.h | 8 ++++---- > include/grub/err.h | 2 +- > 4 files changed, 8 insertions(+), 8 deletions(-) >=20 > diff --git a/grub-core/lib/libgcrypt/src/g10lib.h b/grub-core/lib/libgc= rypt/src/g10lib.h > index 6bde20f..85a51be 100644 > --- a/grub-core/lib/libgcrypt/src/g10lib.h > +++ b/grub-core/lib/libgcrypt/src/g10lib.h > @@ -47,9 +47,9 @@ > #if __GNUC__ > 2 || (__GNUC__ =3D=3D 2 && __GNUC_MINOR__ >=3D 5 ) > #define JNLIB_GCC_M_FUNCTION 1 > #define JNLIB_GCC_A_NR __attribute__ ((noreturn)) > -#define JNLIB_GCC_A_PRINTF( f, a ) __attribute__ ((format (printf,f,a= ))) > +#define JNLIB_GCC_A_PRINTF( f, a ) __attribute__ ((format (__printf__= ,f,a))) > #define JNLIB_GCC_A_NR_PRINTF( f, a ) \ > - __attribute__ ((noreturn, format (printf,f,a))) > + __attribute__ ((noreturn, format (__printf__,f,a))) > #define GCC_ATTR_NORETURN __attribute__ ((__noreturn__)) > #else > #define JNLIB_GCC_A_NR > diff --git a/include/grub/crypto.h b/include/grub/crypto.h > index ec1b980..a24e89d 100644 > --- a/include/grub/crypto.h > +++ b/include/grub/crypto.h > @@ -408,7 +408,7 @@ void _gcry_assert_failed (const char *expr, const c= har *file, int line, > const char *func) __attribute__ ((noreturn))= ; > =20 > void _gcry_burn_stack (int bytes); > -void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (= printf, 1, 2))); > +void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (= __printf__, 1, 2))); > =20 > =20 > #ifdef GRUB_UTIL > diff --git a/include/grub/emu/misc.h b/include/grub/emu/misc.h > index dde48c1..a588ba2 100644 > --- a/include/grub/emu/misc.h > +++ b/include/grub/emu/misc.h > @@ -53,11 +53,11 @@ grub_util_device_is_mapped (const char *dev); > void * EXPORT_FUNC(xmalloc) (grub_size_t size) WARN_UNUSED_RESULT; > void * EXPORT_FUNC(xrealloc) (void *ptr, grub_size_t size) WARN_UNUSED= _RESULT; > char * EXPORT_FUNC(xstrdup) (const char *str) WARN_UNUSED_RESULT; > -char * EXPORT_FUNC(xasprintf) (const char *fmt, ...) __attribute__ ((f= ormat (printf, 1, 2))) WARN_UNUSED_RESULT; > +char * EXPORT_FUNC(xasprintf) (const char *fmt, ...) __attribute__ ((f= ormat (__printf__, 1, 2))) WARN_UNUSED_RESULT; > =20 > -void EXPORT_FUNC(grub_util_warn) (const char *fmt, ...) __attribute__ = ((format (printf, 1, 2))); > -void EXPORT_FUNC(grub_util_info) (const char *fmt, ...) __attribute__ = ((format (printf, 1, 2))); > -void EXPORT_FUNC(grub_util_error) (const char *fmt, ...) __attribute__= ((format (printf, 1, 2), noreturn)); > +void EXPORT_FUNC(grub_util_warn) (const char *fmt, ...) __attribute__ = ((format (__printf__, 1, 2))); > +void EXPORT_FUNC(grub_util_info) (const char *fmt, ...) __attribute__ = ((format (__printf__, 1, 2))); > +void EXPORT_FUNC(grub_util_error) (const char *fmt, ...) __attribute__= ((format (__printf__, 1, 2), noreturn)); > =20 > grub_uint64_t EXPORT_FUNC (grub_util_get_cpu_time_ms) (void); > =20 > diff --git a/include/grub/err.h b/include/grub/err.h > index 9896fcc..1590c68 100644 > --- a/include/grub/err.h > +++ b/include/grub/err.h > @@ -91,6 +91,6 @@ int EXPORT_FUNC(grub_error_pop) (void); > void EXPORT_FUNC(grub_print_error) (void); > extern int EXPORT_VAR(grub_err_printed_errors); > int grub_err_printf (const char *fmt, ...) > - __attribute__ ((format (printf, 1, 2))); > + __attribute__ ((format (__printf__, 1, 2))); > =20 > #endif /* ! GRUB_ERR_HEADER */ >=20 --VmclCmXjMW1B6xf978m4C2gkhdrPR8Uw9 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 Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iF4EAREKAAYFAlLaqtUACgkQmBXlbbo5nOuCvQEAlb0nDChsGLQGnAqtz2RRNoTP xwqdr0QNbtdrqthE178A/jNJI0Dx+y0PA0m19y+2fIKoEOM499VLaOtOzuSNsA// =WQ9L -----END PGP SIGNATURE----- --VmclCmXjMW1B6xf978m4C2gkhdrPR8Uw9--