[libvirt] [RFC PATCH] build: avoid %zu in translated strings

Eric Blake eblake at redhat.com
Wed Aug 18 14:59:16 UTC 2010


On 08/18/2010 08:35 AM, Daniel P. Berrange wrote:
> These printf-args/parse files appear to handle long long int & %llu
> combinations correctly. Since mingw32 lacks any vasprintf() at all, 
> we will be using this gnulib replacement. The vasprintf-posix seems
> to only be used where vasprintf() exists but is broken, thus not on
> mingw32

The vasprintf module only uses the full printf parsing when told to do
so by #ifdef; it prefers the much smaller approach of using snprintf to
do all the work when there is no other compelling reason to use full
parsing.

> 
> I find it strange that vasprintf is a more liberal license than the
> vasprintf-posix, since the former is where all the really cool
> code is - the latter just seems to be a few m4 macros that anyone
> could reimplement with ease.

vasprintf-posix is more than just m4 macros; it also drags in LGPLv3+
module dependencies that implement floating point parsing (such as
printf-ldexp and isnand-nolibm), then does the additional checks for
which #defines to enable.  Among other things, it is these additional
#defines that then force the compelling reason for vasnprintf.c to use
full-blown parsing rather than the smaller footprint of wrapping snprintf.

So our dilemma is that %zu and %llu need to be compelling reasons to
turn on a subset of the full-blown parser, since mingw's snprintf lacks
those, but without also dragging in the LGPLv3+ floating-point handling.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100818/38edcd93/attachment-0001.sig>


More information about the libvir-list mailing list