[Spice-devel] [PATCH spice-server] Use PRIxPTR constant for string formatting

Frediano Ziglio fziglio at redhat.com
Tue Sep 18 10:15:12 UTC 2018


> On Tue, Sep 18, 2018 at 05:56:03AM -0400, Frediano Ziglio wrote:
> > > 
> > > Hey,
> > > 
> > > On Fri, Jun 22, 2018 at 11:28:50AM +0100, Frediano Ziglio wrote:
> > > > These constant are meant to be used in format string for size_t
> > > 
> > > These constants are actually meant for printing uintptr_t, not size_t,
> > > the former is 32 bits on 32 bits systems, and size_t can be 64 bits
> > > there, see https://github.com/freedesktop/spice/pull/1/commits
> > > 
> > > %z is actually C99, and is supported by newer VC++ versions
> > > (
> > > https://docs.microsoft.com/en-us/cpp/c-runtime-library/format-specification-syntax-printf-and-wprintf-functions?view=vs-2017
> > > ), so I'd tend to switch back to %z, ie revert most of this patch.
> > 
> > Please don't do it, we use more MingW and MingW tend to use the old msvcrt
> > which is not much updated,
> > so no %z there.
> 
> Hmm, I'm the one who mentioned Windows, but this is about spice-server
> which has a hard dep on gio-unix anyway. So I'd still switch back to %z,
> and adjust the location causing the warning to %lu.
> 
> Christophe
> 

Not much deep, I already ported it to Windows...

Frediano


More information about the Spice-devel mailing list