On Wed, Jul 22, 2009 at 02:30:55PM -0400, Laine Stump wrote:
On 07/22/2009 11:36 AM, Daniel P. Berrange wrote:
It's actually because I like doing this that I'd like to know the
preferred method of eliminating the warnings I mentioned. There are a
bunch of them pre-existing in the code that I want to get rid of so I
can turn on warnings=error (without turning off these warnings in
CFLAGS), and I want to do it the "accepted" way. For example, from
domain_conf.c:2137:
virDomainReportError(conn, VIR_ERR_XML_ERROR,
_("invalid security type"));
suppose one of the translators made a mistake and updated with a
wrong string from somewhere else replacing it with
"Erreur de securite %s"
for example due to a cut and paste mistake, it's better to see the
%s out than have the application crash, right ;-) ?
Of couse this can happen with formats embedding '%s' but that's just
another argument to use "%s" in my book.
spits out the warning. We all know that it really *is* literal, but
the
macro is changing the class so the compile thinks it isn't. It would be
simple to just change it to:
virDomainReportError(conn, VIR_ERR_XML_ERROR,
"%s", _("invalid security type"));
Feels safer to me, really.
(and there are plenty of those too), but that's inefficient, and
doesn't
do the _() around the "%s" (is that correct or not?).
If someone wants to tell me the preferred way of doing these, I'll
handle the grunt work of making the changes.
Thanks :-)
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit
http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine
http://rpmfind.net/
http://veillard.com/ | virtualization library
http://libvirt.org/