From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LndaX-0004uj-53 for qemu-devel@nongnu.org; Sat, 28 Mar 2009 14:49:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LndaS-0004mb-As for qemu-devel@nongnu.org; Sat, 28 Mar 2009 14:49:00 -0400 Received: from [199.232.76.173] (port=58363 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LndaS-0004mD-3x for qemu-devel@nongnu.org; Sat, 28 Mar 2009 14:48:56 -0400 Received: from verein.lst.de ([213.95.11.210]:43623) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1LndaR-0000Li-Gr for qemu-devel@nongnu.org; Sat, 28 Mar 2009 14:48:55 -0400 Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id n2SImrIF026230 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 28 Mar 2009 19:48:53 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id n2SImrQT026228 for qemu-devel@nongnu.org; Sat, 28 Mar 2009 19:48:53 +0100 Date: Sat, 28 Mar 2009 19:48:53 +0100 From: Christoph Hellwig Message-ID: <20090328184853.GA26111@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] fix format string warnings in block-qcow2.c Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 Index: qemu/block-qcow2.c =================================================================== --- qemu.orig/block-qcow2.c 2009-03-28 19:43:58.494882416 +0100 +++ qemu/block-qcow2.c 2009-03-28 19:48:02.766981793 +0100 @@ -223,8 +223,8 @@ static int qcow_read_extensions(BlockDri #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 @@ static int qcow_read_extensions(BlockDri 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; }