Commit 4c978075d7f012cadd189cd269509a8e0e0c403a

Authored by aliguori
1 parent 081501da

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>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6944 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 3 additions and 3 deletions
block-qcow2.c
@@ -223,8 +223,8 @@ static int qcow_read_extensions(BlockDriverState *bs, uint64_t start_offset, @@ -223,8 +223,8 @@ static int qcow_read_extensions(BlockDriverState *bs, uint64_t start_offset,
223 #endif 223 #endif
224 224
225 if (bdrv_pread(s->hd, offset, &ext, sizeof(ext)) != sizeof(ext)) { 225 if (bdrv_pread(s->hd, offset, &ext, sizeof(ext)) != sizeof(ext)) {
226 - fprintf(stderr, "qcow_handle_extension: ERROR: pread fail from offset %lu\n",  
227 - offset); 226 + fprintf(stderr, "qcow_handle_extension: ERROR: pread fail from offset %llu\n",
  227 + (unsigned long long)offset);
228 return 1; 228 return 1;
229 } 229 }
230 be32_to_cpus(&ext.magic); 230 be32_to_cpus(&ext.magic);
@@ -240,7 +240,7 @@ static int qcow_read_extensions(BlockDriverState *bs, uint64_t start_offset, @@ -240,7 +240,7 @@ static int qcow_read_extensions(BlockDriverState *bs, uint64_t start_offset,
240 case QCOW_EXT_MAGIC_BACKING_FORMAT: 240 case QCOW_EXT_MAGIC_BACKING_FORMAT:
241 if (ext.len >= sizeof(bs->backing_format)) { 241 if (ext.len >= sizeof(bs->backing_format)) {
242 fprintf(stderr, "ERROR: ext_backing_format: len=%u too large" 242 fprintf(stderr, "ERROR: ext_backing_format: len=%u too large"
243 - " (>=%lu)\n", 243 + " (>=%zu)\n",
244 ext.len, sizeof(bs->backing_format)); 244 ext.len, sizeof(bs->backing_format));
245 return 2; 245 return 2;
246 } 246 }