Skip to contentSkip to conversation

w64: Fix compiler warnings (wrong format specifier)

PATCH Applied Stefan Weil 2 participants 2 messages Apr 13, 2013 – Apr 19, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 w64: Fix compiler warnings (wrong format specifier)

GetLastError() returns a DWORD value which is unsigned long, so the correct format specifier is %lu.

---

Debian's w32 cross compiler does not complain about the wrong specifiers, but the w64 cross compiler does.

I'm sorry that I did not notice this before sending the pull request.

 cpus.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
cpus.c +2 -2
index 97e9ab4..3f754c6 100644
@@ -865,7 +865,7 @@ static void qemu_cpu_kick_thread(CPUState *cpu)
         CONTEXT tcgContext;
 
         if (SuspendThread(cpu->hThread) == (DWORD)-1) {
-            fprintf(stderr, "qemu:%s: GetLastError:%d\n", __func__,
+            fprintf(stderr, "qemu:%s: GetLastError:%lu\n", __func__,
                     GetLastError());
             exit(1);
         }
@@ -881,7 +881,7 @@ static void qemu_cpu_kick_thread(CPUState *cpu)
         cpu_signal(0);
 
         if (ResumeThread(cpu->hThread) == (DWORD)-1) {
-            fprintf(stderr, "qemu:%s: GetLastError:%d\n", __func__,
+            fprintf(stderr, "qemu:%s: GetLastError:%lu\n", __func__,
                     GetLastError());
             exit(1);
         }
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 9 lines · Stefan Weil

GetLastError() returns a DWORD value which is unsigned long, so the correct format specifier is %lu.

---

Debian's w32 cross compiler does not complain about the wrong specifiers, but the w64 cross compiler does.

Quoted 6 lines

I'm sorry that I did not notice this before sending the pull request.

 cpus.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Thanks, applied to the trivial patches tree:
https://github.com/stefanha/qemu/commits/trivial-patches

Stefan