From dc9a353cf7de78b9fae3e46410803d487fd2fc8f Mon Sep 17 00:00:00 2001 From: Martin Husemann Date: Sat, 18 Jan 2014 14:47:23 +0100 Subject: qemu 1.7.0 does not build on NetBSD Do not rely on int8_t (and friends) not being preprocessor symbols (or symbols expanding to themselves). On NetBSD (for example) the glue(u, SDATA_TYPE) results in u__int8_t, which is undefined. There is no way to stop cpp expanding inner macros, so just add the few lines explicitly and get rid of the magic. Signed-off-by: Martin Husemann Reviewed-by: Peter Maydell Reviewed-by: Andreas Färber Signed-off-by: Michael Tokarev --- include/exec/softmmu_template.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/exec/softmmu_template.h b/include/exec/softmmu_template.h index c6a544069c..8712dcd091 100644 --- a/include/exec/softmmu_template.h +++ b/include/exec/softmmu_template.h @@ -30,23 +30,26 @@ #define SUFFIX q #define LSUFFIX q #define SDATA_TYPE int64_t +#define DATA_TYPE uint64_t #elif DATA_SIZE == 4 #define SUFFIX l #define LSUFFIX l #define SDATA_TYPE int32_t +#define DATA_TYPE uint32_t #elif DATA_SIZE == 2 #define SUFFIX w #define LSUFFIX uw #define SDATA_TYPE int16_t +#define DATA_TYPE uint16_t #elif DATA_SIZE == 1 #define SUFFIX b #define LSUFFIX ub #define SDATA_TYPE int8_t +#define DATA_TYPE uint8_t #else #error unsupported data size #endif -#define DATA_TYPE glue(u, SDATA_TYPE) /* For the benefit of TCG generated code, we want to avoid the complication of ABI-specific return type promotion and always return a value extended -- cgit v1.2.3-55-g7522 From d5d1507b347b7cd6c3b82459b96f1889b29939ef Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sat, 25 Jan 2014 18:18:23 +0100 Subject: readline: Add missing GCC_FMT_ATTR This fixes a compiler warning with -Werror=missing-format-attribute and allows improved compiler checks for variable argument lists. Signed-off-by: Stefan Weil Reviewed-by: Stefan Hajnoczi Signed-off-by: Michael Tokarev --- include/qemu/readline.h | 3 ++- monitor.c | 3 ++- qemu-io.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/qemu/readline.h b/include/qemu/readline.h index a89fe4a9a9..49efe4e39b 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 80456fbe5b..5ba541dc6f 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 d6690289b8..7f459d8ffe 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); -- cgit v1.2.3-55-g7522