From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NZSnu-0005Oy-Lg for qemu-devel@nongnu.org; Mon, 25 Jan 2010 12:32:46 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NZSnp-0005Gg-Ak for qemu-devel@nongnu.org; Mon, 25 Jan 2010 12:32:45 -0500 Received: from [199.232.76.173] (port=60419 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZSno-0005GP-VQ for qemu-devel@nongnu.org; Mon, 25 Jan 2010 12:32:41 -0500 Received: from moutng.kundenserver.de ([212.227.126.187]:57451) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NZSno-0003F5-BJ for qemu-devel@nongnu.org; Mon, 25 Jan 2010 12:32:40 -0500 Message-ID: <4B5DD596.4040503@mail.berlios.de> Date: Mon, 25 Jan 2010 18:32:06 +0100 From: Stefan Weil MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH] win32: use PRId64 instead of %lld References: <1264368221-3040-1-git-send-email-hpoussin@reactos.org> <20100125100905.GA9019@redhat.com> In-Reply-To: <20100125100905.GA9019@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Herve Poussineau , qemu-devel@nongnu.org, lcapitulino@redhat.com Michael S. Tsirkin schrieb: > On Sun, Jan 24, 2010 at 09:23:41PM +0000, Herve Poussineau wrote: >> Replace %lld occurrences by PRId64. > > This is wrong. > long long values should be printed with %lld. > size_t - with %zd. PRId64 is for int64_t. > size_t => %zu, ssize_t => %zd might be better. And none of them works on win32, so using them there can result in a crash: size_t st = 4711; fprintf(stderr, "st=%zu, %s\n", st, "test"); printf functions on win32 don't know %z. They run fprintf(stderr, "st=zu, %s\n", st, "test"); which results in an memory access fault when printf wants to read the memory at address 0x4711. Regards, Stefan Weil