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: Tue, 17 Aug 2010 16:37:04 -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/17/2010 04:05 PM, Eric Blake wrote:
> Mingw64 lacks %zu, and has the unfortunate setup where
> sizeof(long)==4 but sizeof(size_t)==8.  Since gnulib's
> printf-posix module is not LGPLv2+, the best we can do
> is manually cast to the only portable int type known to
> hold size_t, and rely on gnulib's inttypes.h.
> 

> -                                 _("Failed to write %zu bytes to "
> +                                 _("Failed to write %" PRIuMAX " bytes to "

Hmmm.  Use of PRIuMAX in a translated string produces a .pot file that
refers to the special string <PRIuMAX>, and which requires the
need-formatstring-macros option passed to AM_GNU_GETTEXT in configure.ac
to be universally supported.  If I'm reading gettext.git history
correctly, need-formatstring-macros was added in gettext 0.11.4 (commit
8b45c5df), but had bugs until 0.17 (commit 4e34b2ac); which is newer
than the oldest version of gettext that libvirt is currently willing to
support.  I'm not sure if you get a fixed gettext.m4 by using just using
gnulib's gettext-h module, but using gnulib's gettext module is out of
the question since it would force the use of gettext 0.18.

Bruno, am I missing any details about how to properly use the gettext
formatstring-macros option, and which gettext versions are supported, if
I missed something in my sleuthing through gettext.git?

-- 
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]