[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 5/7] readline: Add missing GCC_FMT_ATTR
From: |
Michael Tokarev |
Subject: |
[Qemu-devel] [PULL 5/7] readline: Add missing GCC_FMT_ATTR |
Date: |
Sun, 2 Feb 2014 20:12:41 +0400 |
From: Stefan Weil <address@hidden>
This fixes a compiler warning with -Werror=missing-format-attribute
and allows improved compiler checks for variable argument lists.
Signed-off-by: Stefan Weil <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
include/qemu/readline.h | 3 ++-
monitor.c | 3 ++-
qemu-io.c | 3 ++-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/include/qemu/readline.h b/include/qemu/readline.h
index a89fe4a..49efe4e 100644
--- a/include/qemu/readline.h
+++ b/include/qemu/readline.h
@@ -5,7 +5,8 @@
#define READLINE_MAX_CMDS 64
#define READLINE_MAX_COMPLETIONS 256
-typedef void ReadLinePrintfFunc(void *opaque, const char *fmt, ...);
+typedef void GCC_FMT_ATTR(2, 3) ReadLinePrintfFunc(void *opaque,
+ const char *fmt, ...);
typedef void ReadLineFlushFunc(void *opaque);
typedef void ReadLineFunc(void *opaque, const char *str,
void *readline_opaque);
diff --git a/monitor.c b/monitor.c
index 80456fb..5ba541d 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4888,7 +4888,8 @@ static void sortcmdlist(void)
/* These functions just adapt the readline interface in a typesafe way. We
* could cast function pointers but that discards compiler checks.
*/
-static void monitor_readline_printf(void *opaque, const char *fmt, ...)
+static void GCC_FMT_ATTR(2, 3) monitor_readline_printf(void *opaque,
+ const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
diff --git a/qemu-io.c b/qemu-io.c
index d669028..7f459d8 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -219,7 +219,8 @@ static char *get_prompt(void)
return prompt;
}
-static void readline_printf_func(void *opaque, const char *fmt, ...)
+static void GCC_FMT_ATTR(2, 3) readline_printf_func(void *opaque,
+ const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
--
1.7.10.4
- [Qemu-devel] [PULL 0/7] Trivial patches for 2014-02-02, Michael Tokarev, 2014/02/02
- [Qemu-devel] [PULL 3/7] i386: Add missing include file for QEMU_PACKED, Michael Tokarev, 2014/02/02
- [Qemu-devel] [PULL 5/7] readline: Add missing GCC_FMT_ATTR,
Michael Tokarev <=
- [Qemu-devel] [PULL 2/7] osdep: drop unused #include "trace.h", Michael Tokarev, 2014/02/02
- [Qemu-devel] [PULL 7/7] tests/.gitignore: Ignore tests/check-qom-interface, Michael Tokarev, 2014/02/02
- [Qemu-devel] [PULL 4/7] tcg/s390: Remove sigill_handler, Michael Tokarev, 2014/02/02
- [Qemu-devel] [PULL 6/7] hw/ppc: Remove unused defines, Michael Tokarev, 2014/02/02
- [Qemu-devel] [PULL 1/7] qemu 1.7.0 does not build on NetBSD, Michael Tokarev, 2014/02/02
- Re: [Qemu-devel] [PULL 0/7] Trivial patches for 2014-02-02, Peter Maydell, 2014/02/05