From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1W4YTQ-0001FZ-Gr for mharc-grub-devel@gnu.org; Sat, 18 Jan 2014 11:10:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4YTG-0001CM-2y for grub-devel@gnu.org; Sat, 18 Jan 2014 11:10:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W4YT7-0007n9-MK for grub-devel@gnu.org; Sat, 18 Jan 2014 11:10:06 -0500 Received: from mail-la0-x231.google.com ([2a00:1450:4010:c03::231]:59271) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4YT7-0007mq-9d for grub-devel@gnu.org; Sat, 18 Jan 2014 11:09:57 -0500 Received: by mail-la0-f49.google.com with SMTP id y1so4408951lam.8 for ; Sat, 18 Jan 2014 08:09:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=4nSubxBMKswJUpunLtedu3EAMsajIKcOWWoCnsWhXPs=; b=tWhyykT3aL6gSSuyH1FpobnjSIWKauhAmpAAQDCKNrTtvqFOGaCOd+1TPKcWfv9Aj9 buoMG4SekYjn11qLVnNlyHdgPQgIIiVwbbWrFpXcygj3McYi9nJR+p+dvGYYUuWRxXwU WCFkCDl71+VilcPd33hBj7vjPk7gZUsYoEAcPa7zqm0gix//aYluuXerVCWvrHn6fh5v 0VrOOKhOlWIxCt19FxcAO2hj/Hx14CbgLlhH3vae8xQluN3kNt/KlvFP+BzOKlw3I13A C1Q6yga4gvSSFItua3L5Dd4oECLXPwHF0JLFP8W0Lz546j5HqXzzhIzZCdqleAKjDjtv uTHQ== X-Received: by 10.112.198.36 with SMTP id iz4mr4648886lbc.14.1390061395173; Sat, 18 Jan 2014 08:09:55 -0800 (PST) Received: from localhost.localdomain (ppp91-76-163-241.pppoe.mtu-net.ru. [91.76.163.241]) by mx.google.com with ESMTPSA id n13sm9375013lbl.17.2014.01.18.08.09.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Jan 2014 08:09:54 -0800 (PST) From: Andrey Borzenkov To: grub-devel@gnu.org Subject: [PATCH v2] fix Mingw W64-32 cross compile failure due to printf redefinition in libintl.h Date: Sat, 18 Jan 2014 20:09:50 +0400 Message-Id: <1390061390-14156-1-git-send-email-arvidjaar@gmail.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1388253611-16848-1-git-send-email-arvidjaar@gmail.com> References: <1388253611-16848-1-git-send-email-arvidjaar@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::231 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:10:14 -0000 In file included from util/misc.c:36:0: ./include/grub/emu/misc.h:56:1: error: 'libintl_printf' is an unrecognized format function type [-Werror=format=] char * EXPORT_FUNC(xasprintf) (const char *fmt, ...) __attribute__ ((format (printf, 1, 2))) WARN_UNUSED_RESULT; ^ ./include/grub/emu/misc.h:58:1: error: 'libintl_printf' is an unrecognized format function type [-Werror=format=] The reason is libintl.h which redefines printf as libintl_printf. The problem is not present in native MinGW build which avoids redefinition. Use (format (__printf__) instead which is valid replacement in GCC. v2: add grub-core/lib/libgcrypt/src/g10lib.h --- 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(-) diff --git a/grub-core/lib/libgcrypt/src/g10lib.h b/grub-core/lib/libgcrypt/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__ == 2 && __GNUC_MINOR__ >= 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 char *file, int line, const char *func) __attribute__ ((noreturn)); 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))); #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__ ((format (printf, 1, 2))) WARN_UNUSED_RESULT; +char * EXPORT_FUNC(xasprintf) (const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2))) WARN_UNUSED_RESULT; -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)); grub_uint64_t EXPORT_FUNC (grub_util_get_cpu_time_ms) (void); 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))); #endif /* ! GRUB_ERR_HEADER */ -- tg: (5ef569d..) u/mingw/attribute_printf (depends on: master)