From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1W76g5-0006p2-UH for mharc-grub-devel@gnu.org; Sat, 25 Jan 2014 12:05:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49942) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W76fz-0006os-74 for grub-devel@gnu.org; Sat, 25 Jan 2014 12:05:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W76fr-0000eX-Hz for grub-devel@gnu.org; Sat, 25 Jan 2014 12:05:47 -0500 Received: from mail-ea0-x236.google.com ([2a00:1450:4013:c01::236]:64272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W76fr-0000ba-7t for grub-devel@gnu.org; Sat, 25 Jan 2014 12:05:39 -0500 Received: by mail-ea0-f182.google.com with SMTP id r15so1550335ead.13 for ; Sat, 25 Jan 2014 09:05:38 -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=DsWwbPD5YPK1b/RbNzfZcBwDPm6tONYDIo6l4JVbVlM=; b=yhJ0Da75pOIqSQuIXvYc0DyIhmbZ22f9dO2gkrsLEIc+iWZakoca2f3qc4Ht1jTgEf nmGU9zq8+mL+vQ5IkgjgmfaDhfhA3XXWhMB090IKXzIeOB+Rahz0M7Enprcybd//e6cu s9CrsDQ8v+eksPKq5c1NWOJ8RGyzIGByXcoSQMaVOr44Zcd2FDkqylf1lpQku3Hb4WGu 6n1f5j4qiqiJE6fTEHd/QyXaxJpPoe9QEio4STDBcQ766VFPFx0n+x8j3/ufIDByxj5A LoAyeDhybqOEV9YWN9HZgtv4hK8N38t7dKT1rVGkrNJXNPmnEJSvqXlrXBMTuQlDAnIy 18GA== X-Received: by 10.14.3.72 with SMTP id 48mr18150316eeg.34.1390669538158; Sat, 25 Jan 2014 09:05:38 -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 u7sm18054252eep.11.2014.01.25.09.05.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 25 Jan 2014 09:05:36 -0800 (PST) Message-ID: <52E3EEDF.7000504@gmail.com> Date: Sat, 25 Jan 2014 18:05:35 +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> <52DAAAD5.5000807@gmail.com> <20140118230208.044b1e22@opensuse.site> <52DAD0F3.9010101@gmail.com> <20140118230950.7d285645@opensuse.site> <52E2CE49.9000105@gmail.com> <20140125195109.69118cbd@opensuse.site> In-Reply-To: <20140125195109.69118cbd@opensuse.site> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="aMcqCwIsai406q5CqPleRHD2eJqXq468v" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::236 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, 25 Jan 2014 17:05:52 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --aMcqCwIsai406q5CqPleRHD2eJqXq468v Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Go ahead On 25.01.2014 16:51, Andrey Borzenkov wrote: > =D0=92 Fri, 24 Jan 2014 21:34:17 +0100 > Vladimir '=CF=86-coder/phcoder' Serbinenko =D0=BF=D0= =B8=D1=88=D0=B5=D1=82: >=20 >> On 18.01.2014 20:09, Andrey Borzenkov wrote: >>> =D0=92 Sat, 18 Jan 2014 20:07:31 +0100 >>> Vladimir '=CF=86-coder/phcoder' Serbinenko =D0=BF= =D0=B8=D1=88=D0=B5=D1=82: >>> >>>> On 18.01.2014 20:02, Andrey Borzenkov wrote: >>>>> + fw.write (f.read ().replace ("(printf,f,a)", "(__printf__,= f,a)").replace ("(printf,f,a)", "(__printf__,f,a)")) >>>> Why replace twice? >>>> >>> >>> Somehow I though they had different number of arguments. Do not know >>> why. Sorry. >>> >> Can you send fixed patch for me to have a look, and, probably, approve= =2E >=20 >=20 > From: Andrey Borzenkov > Subject: [PATCH v3] fix Mingw W64-32 cross compile failure due to print= f redefinition in libintl.h >=20 > 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 > v3: modify g10lib.h during import >=20 > --- > include/grub/crypto.h | 2 +- > include/grub/emu/misc.h | 8 ++++---- > include/grub/err.h | 2 +- > util/import_gcry.py | 6 ++++++ > 4 files changed, 12 insertions(+), 6 deletions(-) >=20 > 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 */ > diff --git a/util/import_gcry.py b/util/import_gcry.py > index 63ebb90..2b3322d 100644 > --- a/util/import_gcry.py > +++ b/util/import_gcry.py > @@ -534,6 +534,12 @@ for src in sorted (os.listdir (os.path.join (indir= , "src"))): > fw.close () > continue > =20 > + if src =3D=3D "g10lib.h": > + fw.write (f.read ().replace ("(printf,f,a)", "(__printf__,f,a)= ")) > + f.close () > + fw.close () > + continue > + > fw.write (f.read ()) > f.close () > fw.close () >=20 >=20 >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel >=20 --aMcqCwIsai406q5CqPleRHD2eJqXq468v 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/ iF4EAREKAAYFAlLj7t8ACgkQmBXlbbo5nOtLdwD/QnFDluIQcH0HgYhnLfUZ8NrH yTm2V56uC65GReT1nKQA/0m9dy4Xck3bqKvrx3Zd6at3koVR9TV9X+bN84/i0Azb =7x2V -----END PGP SIGNATURE----- --aMcqCwIsai406q5CqPleRHD2eJqXq468v--