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 <daniel.kiper@oracle.com>
Signed-off-by: Vladimir Serbinenko <phcoder@google.com>
This commit is contained in:
Vladimir Serbinenko 2019-03-22 16:13:11 +01:00 committed by Vladimir Serbinenko
parent 16910a8cb9
commit f91e4d1633
2 changed files with 7 additions and 10 deletions

View file

@ -24,6 +24,7 @@
#include <stdio.h> #include <stdio.h>
#include <grub/compiler.h>
#include <grub/symbol.h> #include <grub/symbol.h>
#include <grub/types.h> #include <grub/types.h>
#include <grub/misc.h> #include <grub/misc.h>
@ -43,22 +44,17 @@ char *grub_make_system_path_relative_to_its_root (const char *path)
int int
grub_util_device_is_mapped (const char *dev); 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_PRIuLONG_LONG "llu"
#define GRUB_HOST_PRIxLONG_LONG "llx" #define GRUB_HOST_PRIxLONG_LONG "llx"
#endif
void * EXPORT_FUNC(xmalloc) (grub_size_t size) WARN_UNUSED_RESULT; void * EXPORT_FUNC(xmalloc) (grub_size_t size) WARN_UNUSED_RESULT;
void * EXPORT_FUNC(xrealloc) (void *ptr, 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(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_warn) (const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 1, 2)));
void EXPORT_FUNC(grub_util_info) (const char *fmt, ...) __attribute__ ((format (__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 (__printf__, 1, 2), noreturn)); 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); grub_uint64_t EXPORT_FUNC (grub_util_get_cpu_time_ms) (void);

View file

@ -21,6 +21,7 @@
#define GRUB_ERR_HEADER 1 #define GRUB_ERR_HEADER 1
#include <grub/symbol.h> #include <grub/symbol.h>
#include <grub/compiler.h>
#define GRUB_MAX_ERRMSG 256 #define GRUB_MAX_ERRMSG 256
@ -91,6 +92,6 @@ int EXPORT_FUNC(grub_error_pop) (void);
void EXPORT_FUNC(grub_print_error) (void); void EXPORT_FUNC(grub_print_error) (void);
extern int EXPORT_VAR(grub_err_printed_errors); extern int EXPORT_VAR(grub_err_printed_errors);
int grub_err_printf (const char *fmt, ...) int grub_err_printf (const char *fmt, ...)
__attribute__ ((format (__printf__, 1, 2))); __attribute__ ((format (GNU_PRINTF, 1, 2)));
#endif /* ! GRUB_ERR_HEADER */ #endif /* ! GRUB_ERR_HEADER */