[libvirt] [PATCH] remote_driver.c: fix non-literal format strings w/o args

Pushed another of these under the trivial rule (with correct email address this time!). I guess I run into these so often because I build with --disable-nls and most other people don't... --- src/remote/remote_driver.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 4492b6b..f45476a 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -8481,7 +8481,7 @@ remoteStreamEventAddCallback(virStreamPtr st, if (privst->cb) { remoteError(VIR_ERR_INTERNAL_ERROR, - _("multiple stream callbacks not supported")); + "%s", _("multiple stream callbacks not supported")); goto cleanup; } @@ -8521,7 +8521,7 @@ remoteStreamEventUpdateCallback(virStreamPtr st, if (!privst->cb) { remoteError(VIR_ERR_INTERNAL_ERROR, - _("no stream callback registered")); + "%s", _("no stream callback registered")); goto cleanup; } @@ -8548,7 +8548,7 @@ remoteStreamEventRemoveCallback(virStreamPtr st) if (!privst->cb) { remoteError(VIR_ERR_INTERNAL_ERROR, - _("no stream callback registered")); + "%s", _("no stream callback registered")); goto cleanup; } -- 1.7.1

On Thu, Nov 11, 2010 at 12:17:33PM -0500, Laine Stump wrote:
Pushed another of these under the trivial rule (with correct email address this time!).
I guess I run into these so often because I build with --disable-nls and most other people don't...
We're constantly hitting this problem. We can't defalt to --disable-nls though. Is there any way we could practically check this with syntax-check ? Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On 11/11/2010 10:27 AM, Daniel P. Berrange wrote:
On Thu, Nov 11, 2010 at 12:17:33PM -0500, Laine Stump wrote:
Pushed another of these under the trivial rule (with correct email address this time!).
I guess I run into these so often because I build with --disable-nls and most other people don't...
We're constantly hitting this problem. We can't defalt to --disable-nls though. Is there any way we could practically check this with syntax-check ?
Unfortunately, it's not an easy regexp to write, so I'm not sure that we can easily create a syntax check rule. In general, it's tough, because the problem is a multi-line issue: the problem only happens when _("...") is the last argument to a printf-style function, but was not preceded by a "%s" argument. How do you find the end of a _("...") string which might span multiple lines, to see if the next byte was ')'? But we could make ./autobuild.sh do a --disable-nls build, as I periodically run autobuild.sh. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (3)
-
Daniel P. Berrange
-
Eric Blake
-
Laine Stump