From f91e4d163314c2faaceebf4a82119d88499f09a7 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 22 Mar 2019 16:13:11 +0100 Subject: [PATCH] Propagate GNU_PRINTF from gnulib vfprintf gnulib now replaces vfprintf and hence its format becomes GNU_PRINTF format This also fixes matching definitions to always use GNU format Reviewed-by: Daniel Kiper Signed-off-by: Vladimir Serbinenko --- include/grub/emu/misc.h | 14 +++++--------- include/grub/err.h | 3 ++- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/include/grub/emu/misc.h b/include/grub/emu/misc.h index 59b8b35fc..ce464cfd0 100644 --- a/include/grub/emu/misc.h +++ b/include/grub/emu/misc.h @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -43,22 +44,17 @@ char *grub_make_system_path_relative_to_its_root (const char *path) int grub_util_device_is_mapped (const char *dev); -#ifdef __MINGW32__ -#define GRUB_HOST_PRIuLONG_LONG "I64u" -#define GRUB_HOST_PRIxLONG_LONG "I64x" -#else #define GRUB_HOST_PRIuLONG_LONG "llu" #define GRUB_HOST_PRIxLONG_LONG "llx" -#endif 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 (GNU_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 (GNU_PRINTF, 1, 2))); +void EXPORT_FUNC(grub_util_info) (const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 1, 2))); +void EXPORT_FUNC(grub_util_error) (const char *fmt, ...) __attribute__ ((format (GNU_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 1590c688e..24ba9f5f5 100644 --- a/include/grub/err.h +++ b/include/grub/err.h @@ -21,6 +21,7 @@ #define GRUB_ERR_HEADER 1 #include +#include #define GRUB_MAX_ERRMSG 256 @@ -91,6 +92,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 (GNU_PRINTF, 1, 2))); #endif /* ! GRUB_ERR_HEADER */