bug-gnulib
[Top][All Lists]
Advanced

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

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


From: Eric Blake
Subject: Re: [libvirt] [RFC PATCH] build: avoid %zu in translated strings
Date: Wed, 18 Aug 2010 09:54:51 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100720 Fedora/3.1.1-1.fc13 Lightning/1.0b2pre Mnenhy/0.8.3 Thunderbird/3.1.1

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   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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