[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 14/14] w32: Always use standard instead of native fo
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PATCH 14/14] w32: Always use standard instead of native format strings |
Date: |
Sun, 23 Sep 2012 11:00:20 +0100 |
From: Stefan Weil <address@hidden>
GLib 2.0 include files use __printf__ for the format attribute
which resolves to native format strings on w32 hosts.
QEMU wants standard format strings instead of native format
strings, so we simply change any declaration with __printf__
to use __gnu_printf__.
This works because all basic printf functions support both
kinds of format strings.
This fixes a compiler warning:
qapi/string-output-visitor.c: In function ‘print_type_int’:
qapi/string-output-visitor.c:34:5: warning: unknown conversion type character
‘l’ in format [-Wformat]
qapi/string-output-visitor.c:34:5: warning: too many arguments for format
[-Wformat-extra-args]
Signed-off-by: Stefan Weil <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
compiler.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/compiler.h b/compiler.h
index 07ba1f8..c734a71 100644
--- a/compiler.h
+++ b/compiler.h
@@ -44,6 +44,11 @@
/* Use gnu_printf when supported (qemu uses standard format strings). */
# define GCC_ATTR __attribute__((__unused__, format(gnu_printf, 1, 2)))
# define GCC_FMT_ATTR(n, m) __attribute__((format(gnu_printf, n, m)))
+# if defined(_WIN32)
+ /* Map __printf__ to __gnu_printf__ because we want standard format strings
+ * even when MinGW or GLib include files use __printf__. */
+# define __printf__ __gnu_printf__
+# endif
# endif
#if defined(_WIN32)
#define GCC_WEAK __attribute__((weak))
--
1.7.10.4
- [Qemu-devel] [PATCH 04/14] cadence_uart: Fix buffer overflow, (continued)
- [Qemu-devel] [PATCH 04/14] cadence_uart: Fix buffer overflow, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 05/14] lm4549: Fix buffer overflow, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 07/14] pflash_cfi01: Fix warning caused by unreachable code, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 06/14] ioh3420: Remove unreachable code, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 08/14] dtrace backend: add function to reserved words, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 09/14] curses: don't initialize curses when qemu is daemonized, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 10/14] TextConsole: saturate escape parameter in TTY_STATE_CSI, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 11/14] qemu-timer: simplify qemu_run_timers, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 13/14] net/socket: Fix compiler warning (regression for MinGW), Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 12/14] linux-user: Remove redundant null check and replace free by g_free, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 14/14] w32: Always use standard instead of native format strings,
Stefan Hajnoczi <=
- Re: [Qemu-devel] [PULL 00/14] Trivial patches for 15 to 23 September 2012, Anthony Liguori, 2012/09/25