qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] readline: Add missing GCC_FMT_ATTR
@ 2014-01-25 17:18 Stefan Weil
  2014-01-27 12:20 ` Stefan Hajnoczi
  2014-02-01  9:46 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
  0 siblings, 2 replies; 3+ messages in thread
From: Stefan Weil @ 2014-01-25 17:18 UTC (permalink / raw)
  To: qemu-trivial; +Cc: Stefan Weil, qemu-devel, Stefan Hajnoczi

This fixes a compiler warning with -Werror=missing-format-attribute
and allows improved compiler checks for variable argument lists.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] readline: Add missing GCC_FMT_ATTR
  2014-01-25 17:18 [Qemu-devel] [PATCH] readline: Add missing GCC_FMT_ATTR Stefan Weil
@ 2014-01-27 12:20 ` Stefan Hajnoczi
  2014-02-01  9:46 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2014-01-27 12:20 UTC (permalink / raw)
  To: Stefan Weil; +Cc: qemu-trivial, qemu-devel

On Sat, Jan 25, 2014 at 06:18:23PM +0100, Stefan Weil wrote:
> This fixes a compiler warning with -Werror=missing-format-attribute
> and allows improved compiler checks for variable argument lists.
> 
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
>  include/qemu/readline.h |    3 ++-
>  monitor.c               |    3 ++-
>  qemu-io.c               |    3 ++-
>  3 files changed, 6 insertions(+), 3 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] readline: Add missing GCC_FMT_ATTR
  2014-01-25 17:18 [Qemu-devel] [PATCH] readline: Add missing GCC_FMT_ATTR Stefan Weil
  2014-01-27 12:20 ` Stefan Hajnoczi
@ 2014-02-01  9:46 ` Michael Tokarev
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Tokarev @ 2014-02-01  9:46 UTC (permalink / raw)
  To: Stefan Weil; +Cc: qemu-trivial, qemu-devel, Stefan Hajnoczi

25.01.2014 21:18, Stefan Weil wrote:
> This fixes a compiler warning with -Werror=missing-format-attribute
> and allows improved compiler checks for variable argument lists.

Thanks, applied to the trivial-patches queue.

/mjt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-01  9:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-25 17:18 [Qemu-devel] [PATCH] readline: Add missing GCC_FMT_ATTR Stefan Weil
2014-01-27 12:20 ` Stefan Hajnoczi
2014-02-01  9:46 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).