qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [6944] fix format string warnings in block-qcow2.c (Christoph Hellwig)
@ 2009-03-29  1:31 Anthony Liguori
  0 siblings, 0 replies; only message in thread
From: Anthony Liguori @ 2009-03-29  1:31 UTC (permalink / raw)
  To: qemu-devel

Revision: 6944
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6944
Author:   aliguori
Date:     2009-03-29 01:31:56 +0000 (Sun, 29 Mar 2009)
Log Message:
-----------
fix format string warnings in block-qcow2.c (Christoph Hellwig)

Recent patches added two compiler warnings about the format string
usage in qcow_read_extensions.  One is printing a uint64_t using
%lu which is incorrect on many platforms as it can be a unsigned
long long, the second one is printing the result of sizeof as
%lu, but it is a size_t so it needs to be printed using %zu.


Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

Modified Paths:
--------------
    trunk/block-qcow2.c

Modified: trunk/block-qcow2.c
===================================================================
--- trunk/block-qcow2.c	2009-03-29 01:31:51 UTC (rev 6943)
+++ trunk/block-qcow2.c	2009-03-29 01:31:56 UTC (rev 6944)
@@ -223,8 +223,8 @@
 #endif
 
         if (bdrv_pread(s->hd, offset, &ext, sizeof(ext)) != sizeof(ext)) {
-            fprintf(stderr, "qcow_handle_extension: ERROR: pread fail from offset %lu\n",
-                    offset);
+            fprintf(stderr, "qcow_handle_extension: ERROR: pread fail from offset %llu\n",
+                    (unsigned long long)offset);
             return 1;
         }
         be32_to_cpus(&ext.magic);
@@ -240,7 +240,7 @@
         case QCOW_EXT_MAGIC_BACKING_FORMAT:
             if (ext.len >= sizeof(bs->backing_format)) {
                 fprintf(stderr, "ERROR: ext_backing_format: len=%u too large"
-                        " (>=%lu)\n",
+                        " (>=%zu)\n",
                         ext.len, sizeof(bs->backing_format));
                 return 2;
             }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-03-29  1:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-29  1:31 [Qemu-devel] [6944] fix format string warnings in block-qcow2.c (Christoph Hellwig) Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).