[PATCH] libselinux: avc_internal.c: allow building with clang

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

 



Resolves the following errors from clang:
avc_internal.c:105:25: error: cast from 'char *' to 'struct nlmsghdr *' increases required alignment from 1 to 4 [-Werror,-Wcast-align]
        struct nlmsghdr *nlh = (struct nlmsghdr *)buf;
                               ^~~~~~~~~~~~~~~~~~~~~~
avc_internal.c:161:25: error: cast from 'char *' to 'struct nlmsghdr *' increases required alignment from 1 to 4 [-Werror,-Wcast-align]
        struct nlmsghdr *nlh = (struct nlmsghdr *)buf;
                               ^~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Stephen Smalley <sds@xxxxxxxxxxxxx>
---
 libselinux/src/avc_internal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libselinux/src/avc_internal.c b/libselinux/src/avc_internal.c
index be94857..26f3360 100644
--- a/libselinux/src/avc_internal.c
+++ b/libselinux/src/avc_internal.c
@@ -96,7 +96,7 @@ void avc_netlink_close(void)
 	fd = -1;
 }
 
-static int avc_netlink_receive(char *buf, unsigned buflen, int blocking)
+static int avc_netlink_receive(void *buf, unsigned buflen, int blocking)
 {
 	int rc;
 	struct pollfd pfd = { fd, POLLIN | POLLPRI, 0 };
@@ -155,7 +155,7 @@ static int avc_netlink_receive(char *buf, unsigned buflen, int blocking)
 	return 0;
 }
 
-static int avc_netlink_process(char *buf)
+static int avc_netlink_process(void *buf)
 {
 	int rc;
 	struct nlmsghdr *nlh = (struct nlmsghdr *)buf;
-- 
2.7.4

_______________________________________________
Selinux mailing list
Selinux@xxxxxxxxxxxxx
To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx.
To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.



[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux