From e5924d8980e0bd027f2f12fa702ec1c555538230 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Thu, 23 Sep 2010 21:28:03 +0200 Subject: Replace most gcc format attributes by macro GCC_FMT_ATTR (format checking) Since version 4.4.x, gcc supports additional format attributes. __attribute__ ((format (gnu_printf, 1, 2))) should be used instead of __attribute__ ((format (printf, 1, 2)) because QEMU always uses standard format strings (even with mingw32). The patch replaces format attribute printf / __printf__ by macro GCC_FMT_ATTR which uses gnu_printf if supported. It also removes an #ifdef __GNUC__ (not needed any longer). Cc: Blue Swirl Signed-off-by: Stefan Weil Signed-off-by: Blue Swirl --- qemu-error.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'qemu-error.h') diff --git a/qemu-error.h b/qemu-error.h index a45609f8e7..531ec63fee 100644 --- a/qemu-error.h +++ b/qemu-error.h @@ -31,11 +31,10 @@ void loc_set_cmdline(char **argv, int idx, int cnt); void loc_set_file(const char *fname, int lno); void error_vprintf(const char *fmt, va_list ap); -void error_printf(const char *fmt, ...) __attribute__ ((format(printf, 1, 2))); -void error_printf_unless_qmp(const char *fmt, ...) - __attribute__ ((format(printf, 1, 2))); +void error_printf(const char *fmt, ...) GCC_FMT_ATTR(1, 2); +void error_printf_unless_qmp(const char *fmt, ...) GCC_FMT_ATTR(1, 2); void error_print_loc(void); void error_set_progname(const char *argv0); -void error_report(const char *fmt, ...) __attribute__ ((format(printf, 1, 2))); +void error_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2); #endif -- cgit v1.2.1