
On 06/19/2014 08:42 AM, Roman Bogorodskiy wrote:
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(-)
NACK. pagesize is the wrong type. The correct fix is to use a correctly-typed intermediate variable. I'll post my proposal shortly.
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;
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org