bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] maintainer-makefile: check for i18n setup


From: Eric Blake
Subject: Re: [PATCH] maintainer-makefile: check for i18n setup
Date: Fri, 12 Nov 2010 09:39:40 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101103 Fedora/1.0-0.33.b2pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.6

On 11/12/2010 12:26 AM, Jim Meyering wrote:
> Eric Blake wrote:
>> * top/maint.mk (sc_bindtextdomain): Check for evidence that _()
>> will likely work.
>>
>> I recently debugged a situation in libvirt where a program had
>> not set up the i18n framework, therefore calls to _() were doing
>> nothing.  If this rule had been in place, I would have quickly
>> detected that main() was not properly initializing gettext
>> during 'make syntax-check'.

I suppose I could also check for the setlocale() call, or even both of
them, but I'm not sure it's worth the complexity for doing a multi-line
grep.

>> +sc_bindtextdomain:
>> +    @require='bindtextdomain *\('                                   \
>> +    in_vc_files='\.c$$'                                             \
>> +    containing='\<main *('                                          \
>> +    halt='the above files do not call bindtextdomain'               \
>> +      $(_sc_search_regexp)
> 
> I was going to suggest making the 'require'd regexp
> configurable, in case someone wraps initialization
> code like that in a helper function.  Then they
> could require their initialization function instead.
> 
> But this might count as pre-optimization.
> I.e., perhaps no gnulib-using client does that.
> At worst, we can wait until someone who does such
> a thing complains about their false positives.

Sounds reasonable to me.  With that, I've pushed it to gnulib.

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