diff --git a/include/qemu/readline.h b/include/qemu/readline.h index a89fe4a9a9644c5af3ef50b560e1247b95e08cdf..49efe4e39b491a34a2478327d67c2e53b97b7842 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 80456fbe5b01f8633e4a43ce21ec7183ce5572d6..5ba541dc6f1c5756814a308ee30a7e83364a4110 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 d6690289b82bcdd19cc420d3c3ce5892b5df8f27..7f459d8ffe4fc655a02e5e16974cb6311789ac03 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);