qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: [PATCH] win32: use PRId64 instead of %lld


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] Re: [PATCH] win32: use PRId64 instead of %lld
Date: Mon, 25 Jan 2010 19:47:56 +0200
User-agent: Mutt/1.5.19 (2009-01-05)

On Mon, Jan 25, 2010 at 06:32:06PM +0100, Stefan Weil wrote:
> 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

Let's just implement a compliant printf?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]