From c1b4e0f31d245f9c32fa787897961c761f023651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Tue, 4 Apr 2017 12:51:47 +0200 Subject: [PATCH] util: ignore -Wcast-align in virNetlinkDumpCommand Similar to commit b202c39 ignore the warning that breaks the build with clang: util/virnetlink.c:365:52: error: cast from 'char *' to 'struct nlmsghdr *' increases required alignment from 1 to 4 [-Werror,-Wcast-align] for (msg = resp; NLMSG_OK(msg, len); msg = NLMSG_NEXT(msg, len)) { ^~~~~~~~~~~~~~~~~~~~ /usr/include/linux/netlink.h:87:7: note: expanded from macro 'NLMSG_NEXT' (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len))) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (cherry picked from commit 04be4111d90193016a390ecdd144bc80fa5667ef) --- src/util/virnetlink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c index 9bc1f0f2bd..92ecf77dc8 100644 --- a/src/util/virnetlink.c +++ b/src/util/virnetlink.c @@ -361,8 +361,9 @@ virNetlinkDumpCommand(struct nl_msg *nl_msg, while (!end) { len = nl_recv(nlhandle, &nladdr, (unsigned char **)&resp, NULL); - + VIR_WARNINGS_NO_CAST_ALIGN for (msg = resp; NLMSG_OK(msg, len); msg = NLMSG_NEXT(msg, len)) { + VIR_WARNINGS_RESET if (msg->nlmsg_type == NLMSG_DONE) end = true;