From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LnjtW-00084W-Cf for qemu-devel@nongnu.org; Sat, 28 Mar 2009 21:33:02 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LnjtR-00082N-Uv for qemu-devel@nongnu.org; Sat, 28 Mar 2009 21:33:02 -0400 Received: from [199.232.76.173] (port=34380 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LnjtR-00082F-HX for qemu-devel@nongnu.org; Sat, 28 Mar 2009 21:32:57 -0400 Received: from e5.ny.us.ibm.com ([32.97.182.145]:52445) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LnjtR-00044s-5g for qemu-devel@nongnu.org; Sat, 28 Mar 2009 21:32:57 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e5.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n2T1T7Ct015991 for ; Sat, 28 Mar 2009 21:29:07 -0400 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n2T1WuOE161930 for ; Sat, 28 Mar 2009 21:32:56 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n2T1WtFW006684 for ; Sat, 28 Mar 2009 21:32:55 -0400 Received: from squirrel.codemonkey.ws (sig-9-65-208-188.mts.ibm.com [9.65.208.188]) by d01av03.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n2T1Wste006657 for ; Sat, 28 Mar 2009 21:32:55 -0400 Message-ID: <49CECFC6.6010602@us.ibm.com> Date: Sat, 28 Mar 2009 20:32:54 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] fix format string warnings in block-qcow2.c References: <20090328184853.GA26111@lst.de> In-Reply-To: <20090328184853.GA26111@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 Christoph Hellwig wrote: > 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 > Applied. Thanks. Regards, Anthony Liguori > 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; > } > > > >