bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] snprintf: guarantee %1$d, for libintl


From: Eric Blake
Subject: Re: [PATCH] snprintf: guarantee %1$d, for libintl
Date: Tue, 05 Jul 2011 10:17:02 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10

On 07/03/2011 06:39 PM, Bruno Haible wrote:
> Hi Eric,
> 
>> diff --git a/ChangeLog b/ChangeLog
>> index fcc2e6e..5f3ffb7 100644
>> --- a/ChangeLog
>> +++ b/ChangeLog
>> @@ -1,3 +1,13 @@
>> +2011-07-01  Eric Blake  <address@hidden>
>> +
>> +    snprintf: guarantee %1$d, for libintl
>> +    * m4/snprintf.m4 (gl_FUNC_SNPRINTF): Require %1$d support.
>> +    * m4/vsnprintf.m4 (gl_FUNC_VSNPRINTF): Likewise.
>> +    * doc/posix-functions/snprintf.texi (snprintf): Update.
>> +    * doc/posix-functions/vsnprintf.texi (vsnprintf): Likewise.
>> +    * tests/test-snprintf.c (main): Enhance test.
>> +    * tests/test-vsnprintf.c (main): Likewise.
> 
> This patch is all right.
> 
> I knew it was risky to provide an snprintf replacement in libintl that fixes
> the %n$ interpretation but not the return value, and on the other hand gnulib
> also may or may not replace snprintf... Thanks for all the analysis.
> 
> The changes warrant some comments, but we can add them later. I'm too tired 
> for
> today.

I added this comment in the .m4 files:

dnl Libintl 0.17 will replace snprintf only if it does not support %1$s,
dnl but defers to any gnulib snprintf replacements.  Therefore, gnulib
dnl must guarantee that the decision for replacing snprintf is a superset
dnl of the reasons checked by libintl.

then pushed; if you want to add further comments, go right ahead.

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