Hi,
please find the following trivial warning fix patch for
kvm-60/user/test/x86/*
below. Feel free to merge to upstream kvm. It's diffed against kvm-60.
The patch does not change things, just shuts up the warnings.
The deal here is that we check for warnings and are alerted of warnings which
include language like:
"is used uninitialized in this function"
---------^^ (not may)
which indicate a true programming error and are prominently recognized.
Fixing the same warning message made me fix a terrible bug in libksba
(a library which deals with X.509 certificates, CMS data, and related data
which is used by
GnuPG) which surfaced with the use of the new gcc-4.3 compiler suite.
gcc-4.3 optimizes better and the probabitlity that uninitialized value
actually starts off with a non-zero value really increases with gcc-4.3.
I did not test this patch as I did not find documentation on how to run the
test cases and I could not find a make target to run them from make.
Bernhard
----------------
This patch fixes the following warnings on x86_64:
test/x86/access.c: In function 'ac_test_exec':
test/x86/access.c:541: warning: implicit declaration of function 'strcat'
test/x86/access.c: In function 'main':
test/x86/access.c:577: warning: passing argument 1 of 'smp_init' from
incompatible pointer type
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'
Note: 'tmp' is only used in inline assembly, so the initialisation of it may be
done in a more elegant way, but just setting it to 0 should hopefully just
achive the same functional result as no initialisation (most of the time...).
Signed-off-by: Bernhard Kaindl <[EMAIL PROTECTED]>
---
access.c | 8 +++++++-
emulator.c | 3 +--
lib/printf.c | 1 -
3 files changed, 8 insertions(+), 4 deletions(-)
--- kvm-60/user/test/x86/access.c
+++ kvm-60/user/test/x86/access.c 2008/01/24 15:14:16
@@ -1,6 +1,7 @@
#include "smp.h"
#include "printf.h"
+#include "string.h"
#define true 1
#define false 0
@@ -569,7 +570,7 @@
int r;
printf("starting test\n\n");
- smp_init(ac_test_run);
+ smp_init((void (*)(void))ac_test_run);
r = ac_test_run();
return r ? 0 : 1;
}
--- kvm-60/user/test/x86/emulator.c
+++ kvm-60/user/test/x86/emulator.c 2008/01/24 15:08:16
@@ -23,7 +23,6 @@
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;
@@ -105,7 +104,7 @@
void test_push(void *mem)
{
- unsigned long tmp;
+ unsigned long tmp = 0;
unsigned long *stack_top = mem + 4096;
unsigned long *new_stack_top;
unsigned long memw = 0x123456789abcdeful;
--- kvm-60/user/test/x86/lib/printf.c
+++ kvm-60/user/test/x86/lib/printf.c 2008/01/24 15:10:35
@@ -92,7 +92,6 @@
int vsnprintf(char *buf, int size, const char *fmt, va_list va)
{
- int n;
pstream_t s;
s.buffer = buf;
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel