From patchwork Tue Nov 1 21:01:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Smalley X-Patchwork-Id: 9408029 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 55F1460234 for ; Tue, 1 Nov 2016 20:59:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 47D4429A9A for ; Tue, 1 Nov 2016 20:59:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B0F629A9C; Tue, 1 Nov 2016 20:59:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from emsm-gh1-uea11.nsa.gov (emsm-gh1-uea11.nsa.gov [8.44.101.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9882729A9A for ; Tue, 1 Nov 2016 20:59:10 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.31,433,1473120000"; d="scan'208";a="410378" IronPort-PHdr: =?us-ascii?q?9a23=3AOzwHMBwdc8NPDSHXCy+O+j09IxM/srCxBDY+r6Qd?= =?us-ascii?q?0e8XIJqq85mqBkHD//Il1AaPBtSBraIdwLOK6ujJYi8p2d65qncMcZhBBVcuqP?= =?us-ascii?q?49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL2PbrnD61zMOABK3bVMz?= =?us-ascii?q?fbWvXN6LxJ3rjqibwN76W01wnj2zYLd/fl2djD76kY0ou7ZkMbs70RDTo3FFKK?= =?us-ascii?q?x8zGJsIk+PzV6nvp/jtKN592xsn95pt4saCeSpN5g/GKdVCDUgLnAd+NzgtR6F?= =?us-ascii?q?SxCGoHQbTDY4iB1NVjPZ4Qn6U5G5iS7zsu5wyWHOJsHtZawlUjSlqaFwQVnnjz?= =?us-ascii?q?lRZG1xy33elsEl1PETmxmmvREqhtSMbQ=3D=3D?= X-IPAS-Result: =?us-ascii?q?A2FSBAD4ABlY/wHyM5BdGwEBAQMBAQEJAQEBFwEBBAEBCgE?= =?us-ascii?q?Bgn8BAQEBAR+BRQ+6dimIHVMBAQEBAQEBAQIBAl8ogjMEAxMFghcCNxQgCwMDC?= =?us-ascii?q?QIXKQgIAwEtFR8LBRgEiDO4ViWPKxEBaIUUBZoakDUCigiFegJJkE5UUgYIgyQ?= =?us-ascii?q?cgW9WhTB4gTQBAQE?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea11.nsa.gov with ESMTP; 01 Nov 2016 20:59:08 +0000 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus [192.168.25.40]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id uA1Kx0DL009014; Tue, 1 Nov 2016 16:59:02 -0400 Received: from tarius.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id uA1KwxNM038431 for ; Tue, 1 Nov 2016 16:58:59 -0400 Received: from moss-pluto.infosec.tycho.ncsc.mil (moss-pluto [192.168.25.131]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id uA1KwxWN009003; Tue, 1 Nov 2016 16:58:59 -0400 From: Stephen Smalley To: selinux@tycho.nsa.gov Subject: [PATCH] libselinux: avc_internal.c: allow building with clang Date: Tue, 1 Nov 2016 17:01:44 -0400 Message-Id: <1478034104-25583-1-git-send-email-sds@tycho.nsa.gov> X-Mailer: git-send-email 2.7.4 X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: Cc: Stephen Smalley MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;