[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Remove warning 'format not a string literal' in libsvn_client

From: Branko Cibej <brane_at_xbc.nu>
Date: Thu, 05 Nov 2009 19:18:29 +0100

Peter Samuelson wrote:
> [Daniel Näslund]
>
>> if (! original_value)
>> - header_fmt = _("Added: %s%s");
>> + SVN_ERR(file_printf_from_utf8(file, encoding, "Added: %s%s",
>> + propchange->name, APR_EOL_STR));
>>
>
> Julian talked about this code already, but just to point out: your
> change is incorrect, because it removes the _() functionality, i.e.,
> string localisation. You have to be careful about these things.
>
> ...Indeed, we use quite a lot of _() with printf format strings (see
> all the references to 'c-format' in tools/po/po-update.sh). Why
> aren't these _all_ warnings with your compiler?
>

Because his compiler is probably gcc, and gcc "sees" through gettext()
and friends; in other words, libintl.h declares the necessary function
attributes that allow gcc to make assumptions about the return values
based on function arguments.

-- Brane

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2414863
Received on 2009-11-05 19:18:46 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.