qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 7/9] Add -Wmissing-format-attribute & fix problems i


From: Daniel P. Berrange
Subject: [Qemu-devel] [PATCH 7/9] Add -Wmissing-format-attribute & fix problems it finds
Date: Mon, 2 Apr 2012 11:50:14 +0100

From: "Daniel P. Berrange" <address@hidden>

* configure: Add -Wmissing-format-attribute
* hw/qxl.c: Add missing format attribute to qxl_guest_bug
  and fix format specifiers in a caller of it
* qtest.c: Add missing format attribute to qtest_send

Signed-off-by: Daniel P. Berrange <address@hidden>
---
 configure |    1 +
 hw/qxl.c  |    4 ++--
 qtest.c   |    2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 8ee6cdb..3d47440 100755
--- a/configure
+++ b/configure
@@ -1193,6 +1193,7 @@ gcc_flags="$gcc_flags -Wtrampolines"
 gcc_flags="$gcc_flags -Wmissing-parameter-type"
 gcc_flags="$gcc_flags -Wuninitialized"
 gcc_flags="$gcc_flags -Wlogical-op"
+gcc_flags="$gcc_flags -Wmissing-format-attribute"
 
 cat > $TMPC << EOF
 int main(void) { return 0; }
diff --git a/hw/qxl.c b/hw/qxl.c
index 47a162e..33b2288 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -124,7 +124,7 @@ static void qxl_reset_memslots(PCIQXLDevice *d);
 static void qxl_reset_surfaces(PCIQXLDevice *d);
 static void qxl_ring_set_dirty(PCIQXLDevice *qxl);
 
-void qxl_guest_bug(PCIQXLDevice *qxl, const char *msg, ...)
+GCC_FMT_ATTR(2, 3) void qxl_guest_bug(PCIQXLDevice *qxl, const char *msg, ...)
 {
     qxl_send_events(qxl, QXL_INTERRUPT_ERROR);
     if (qxl->guestdebug) {
@@ -1370,7 +1370,7 @@ async_common:
     case QXL_IO_DESTROY_SURFACE_WAIT:
         if (val >= NUM_SURFACES) {
             qxl_guest_bug(d, "QXL_IO_DESTROY_SURFACE (async=%d):"
-                             "%d >= NUM_SURFACES", async, val);
+                             "%"PRIx64" >= NUM_SURFACES", async, val);
             goto cancel_async;
         }
         qxl_spice_destroy_surface_wait(d, val, async);
diff --git a/qtest.c b/qtest.c
index cd7186c..2b71de3 100644
--- a/qtest.c
+++ b/qtest.c
@@ -156,7 +156,7 @@ static void qtest_send_prefix(CharDriverState *chr)
             tv.tv_sec, tv.tv_usec);
 }
 
-static void qtest_send(CharDriverState *chr, const char *fmt, ...)
+GCC_FMT_ATTR(2, 3) static void qtest_send(CharDriverState *chr, const char 
*fmt, ...)
 {
     va_list ap;
     char buffer[1024];
-- 
1.7.7.6




reply via email to

[Prev in Thread] Current Thread [Next in Thread]