From 8443b58c36b74ced1473aa509a958d3a9d90d383 Mon Sep 17 00:00:00 2001 From: Bernhard Kaindl Date: Thu, 24 Jan 2008 18:43:26 +0100 Subject: [PATCH] kvm: testsuite: silence warnings on x86_64 This patch fixes user/test/x86/emulator.flat on kvm-59 with x86_64/E6850 and three other warnings: test/x86/access.c: In function 'ac_test_exec': test/x86/access.c:541: warning: implicit declaration of function 'strcat' test/x86/emulator.c: In function 'test_cmps': test/x86/emulator.c:26: warning: unused variable 'i' test/x86/emulator.c: In function 'test_push': test/x86/emulator.c:115: warning: 'tmp' is used uninitialized in this function test/x86/lib/printf.c: In function 'vsnprintf': test/x86/lib/printf.c:95: warning: unused variable 'n' Signed-off-by: Bernhard Kaindl Signed-off-by: Avi Kivity --- kvm/user/test/x86/access.c | 1 + kvm/user/test/x86/emulator.c | 5 ++--- kvm/user/test/x86/lib/printf.c | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/kvm/user/test/x86/access.c b/kvm/user/test/x86/access.c index adfb944ab8..daeb272774 100644 --- a/kvm/user/test/x86/access.c +++ b/kvm/user/test/x86/access.c @@ -1,6 +1,7 @@ #include "smp.h" #include "printf.h" +#include "string.h" #define true 1 #define false 0 diff --git a/kvm/user/test/x86/emulator.c b/kvm/user/test/x86/emulator.c index d3fb9993de..54f7662ffa 100644 --- a/kvm/user/test/x86/emulator.c +++ b/kvm/user/test/x86/emulator.c @@ -23,7 +23,6 @@ void test_cmps(void *mem) unsigned char m3[1024]; void *rsi, *rdi; long rcx, tmp; - int i; for (int i = 0; i < 100; ++i) m1[i] = m2[i] = m3[i] = i; @@ -119,8 +118,8 @@ void test_push(void *mem) "pushq (%[mem]) \n\t" "mov %%rsp, %[new_stack_top] \n\t" "mov %[tmp], %%rsp" - : [new_stack_top]"=r"(new_stack_top) - : [tmp]"r"(tmp), [stack_top]"r"(stack_top), + : [tmp]"=&r"(tmp), [new_stack_top]"=r"(new_stack_top) + : [stack_top]"r"(stack_top), [reg]"r"(-17l), [mem]"r"(&memw) : "memory"); diff --git a/kvm/user/test/x86/lib/printf.c b/kvm/user/test/x86/lib/printf.c index 29249e5928..f70eb1fc34 100644 --- a/kvm/user/test/x86/lib/printf.c +++ b/kvm/user/test/x86/lib/printf.c @@ -92,7 +92,6 @@ void print_unsigned(pstream_t *ps, unsigned long long n, int base) int vsnprintf(char *buf, int size, const char *fmt, va_list va) { - int n; pstream_t s; s.buffer = buf; -- 2.11.4.GIT