[libvirt] [PATCH] build: fix build without i18n

Eric Blake eblake at redhat.com
Thu Jun 7 03:16:14 UTC 2012


If you compile without NLS support, where _() is a no-op macro,
then we end up passing a string literal to a char*, provoking:

In file included from virsh.c:3639:0:
virsh-edit.c: In function ‘cmdSaveImageEdit’:
virsh-edit.c:97:13: error: assignment discards ‘const’ qualifier from pointer target type [-Werror]
virsh-edit.c:106:13: error: assignment discards ‘const’ qualifier from pointer target type [-Werror]

* tools/virsh-edit.c: Be const-safe.
---

Pushing under the build-breaker rule.

 tools/virsh-edit.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/virsh-edit.c b/tools/virsh-edit.c
index aa59f25..27140e2 100644
--- a/tools/virsh-edit.c
+++ b/tools/virsh-edit.c
@@ -55,7 +55,7 @@ do {
     char *doc = NULL;
     char *doc_edited = NULL;
     char *doc_reread = NULL;
-    char *msg = NULL;
+    const char *msg = NULL;

     /* Get the XML configuration of the object. */
     doc = (EDIT_GET_XML);
-- 
1.7.10.2




More information about the libvir-list mailing list