On 08/18/2010 08:30 AM, Eric Blake wrote:
Still, I'm reluctant to bite the bullet and go with the LGPLv2+
cascade
on vasprintf-posix. So maybe the solution is an intermediate module:
LGPLv2+ vasprintf - bare bones, guarantees a wrapper around system
printf, so %zu and %llu are unsafe because of mingw
LGPLv2+ vasprintf-sizes - guarantees %zu, %llu, %ju, %tu; but not %Lg
(which means splitting gl_PRINTF_SIZES_C99 into two) or %'d
LGPLV3+ vasprintf-posix - guarantees full contingency of POSIX specifiers
If this three-level proposal makes sense, then I can start on the work
of extracting the simpler portions of vasprintf-posix into the new
vasprintf-sizes.
Actually, after looking into this deeper, it (happily) appears that I
may have been mistaken. It looks like the gnulib vasprintf module
_already_ performs printf parsing on mingw; and that as a virtue of that
printf parsing, %zu and %llu are already rewritten into modifiers
understood by mingw. I tested this by modifying test-vasprintf.c to try
%zu and %llu on a mingw compilation, and the test still passed.
The gnulib module snprintf will likewise support %zu and %llu, but only
if it is in use (right now, libvirt is not using the snprintf module).
However, there is no counterpart printf or sprintf, but libvirt uses
those functions as well. So there is still some work to be done in
libvirt to make sure all *printf() family calls eventually end up going
through gnulib wrappers, to take advantage of the fact that gnulib's
vasprintf _is_ sufficient to support %zu and %llu on mingw.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org