[PATCH] Fix cast error in virsh-host.c

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

 



Build with clang fails on virsh-host.c:

virsh-host.c:323:53: error: cast from 'unsigned int *' to 'unsigned long long *' increases required alignment from 4 to 8 [-Werror,-Wcast-align]
        if (vshCommandOptScaledInt(cmd, "pagesize", (unsigned long long *) pagesize,

Fix that by casting pagesize to void* first.
---
 tools/virsh-host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/virsh-host.c b/tools/virsh-host.c
index 2d6cb00..05e3fea 100644
--- a/tools/virsh-host.c
+++ b/tools/virsh-host.c
@@ -320,7 +320,7 @@ cmdFreepages(vshControl *ctl, const vshCmd *cmd)
         }
 
         pagesize = vshMalloc(ctl, sizeof(*pagesize));
-        if (vshCommandOptScaledInt(cmd, "pagesize", (unsigned long long *) pagesize,
+        if (vshCommandOptScaledInt(cmd, "pagesize", (unsigned long long *)(void  *) pagesize,
                                    1, UINT_MAX) < 0) {
             vshError(ctl, "%s", _("page size has to be a number"));
             goto cleanup;
-- 
1.9.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]