From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MMI32-0003Lt-UR for qemu-devel@nongnu.org; Thu, 02 Jul 2009 04:53:40 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MMI2y-0003Ko-CP for qemu-devel@nongnu.org; Thu, 02 Jul 2009 04:53:40 -0400 Received: from [199.232.76.173] (port=34204 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MMI2y-0003Kl-8x for qemu-devel@nongnu.org; Thu, 02 Jul 2009 04:53:36 -0400 Received: from mail2.shareable.org ([80.68.89.115]:52078) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MMI2x-0007f2-Lt for qemu-devel@nongnu.org; Thu, 02 Jul 2009 04:53:35 -0400 Date: Thu, 2 Jul 2009 09:53:31 +0100 From: Jamie Lokier Subject: Re: [Qemu-devel] [PATCH] fix hw/scsi-disk.c compile errors Message-ID: <20090702085331.GA1497@shareable.org> References: <4A4BF3FB.90805@earthlink.net> <4A4C57DA.8010202@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4A4C57DA.8010202@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel , Robert Reif Gerd Hoffmann wrote: > On 07/02/09 01:40, Robert Reif wrote: > >This patch fixes 2 compile errors when debugging is enabled. > > > >CC scsi-disk.o > >cc1: warnings being treated as errors > >/home/reif/qemu/hw/scsi-disk.c: In function ‘scsi_send_command’: > >/home/reif/qemu/hw/scsi-disk.c:797: error: format ‘%d’ expects type > >‘int’, but argument 2 has type ‘uint64_t’ > > > - DPRINTF("Synchronise cache (sector %d, count %d)\n", lba, len); > > + DPRINTF("Synchronise cache (sector %lld, count %d)\n", lba, > len); > > Doesn't work. Well, it works on 32bit, but will fail on 64bit. Use the > macros provided by inttypes.h instead, i.e. > > "... (sector %" PRId64 ", count ...", lba Given the error, PRIu64 looks better. -- Jamie