Re: [PATCH libvirt 3/6] Fix warnings about pid_t printf format on mingw64

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

 



On Wed, Jan 25, 2012 at 05:54:19PM -0700, Eric Blake wrote:
> On 01/25/2012 05:22 PM, Marc-André Lureau wrote:
> >> the decision should _not_ be based on _WIN64, but instead on a
> >> configure-time test on the underlying type of pid_t.  And since
> >> _that_
> >> gets difficult, I'd almost rather go with the simpler approach of:
> >>
> >> "%" PRIdMAX, (intmax_t) pid
> >>
> >> everywhere that we currently use
> >>
> >> "%d", pid
> >>
> > 
> > I thought about using that solution, but I prefer the format macro.

> > Tbh, I wish some of these would be part of gnulib (perhaps some already are).
> 
> Sadly, no one has made a case for extended type macros in gnulib.  And
> mingw points out the problem - we can't use "lld" nor PRIdMAX for pid_t,
> since we don't know whether the code is targetting gnu printf, windows
> printf, or a mix.  I really do think we're stuck with casting to (long
> long) or (intmax_t) in this case :(

But we can use 'lld' because we made sure all libvirt code goes
via the gnulib printf replacements which guarentee %lld works
correctly.


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]