Received: by mail.netbsd.org (Postfix, from userid 605) id 097BE14A3AF; Sun, 29 Jan 2012 18:33:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 9DD0D14A3AA for ; Sun, 29 Jan 2012 18:33:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at NetBSD.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.NetBSD.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id 5CWjrzNXXLAq for ; Sun, 29 Jan 2012 18:33:07 +0000 (UTC) Received: from cvs.netbsd.org (cvs.NetBSD.org [IPv6:2001:4f8:3:7:2e0:81ff:fe30:95bd]) by mail.netbsd.org (Postfix) with ESMTP id 2A99D14A384 for ; Sun, 29 Jan 2012 18:33:07 +0000 (UTC) Received: by cvs.netbsd.org (Postfix, from userid 500) id 66C70175DD; Sun, 29 Jan 2012 18:33:07 +0000 (UTC) MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Date: Sun, 29 Jan 2012 18:33:07 +0000 From: "Roy Marples" Subject: CVS commit: src/sys/sys To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20120129183307.66C70175DD@cvs.netbsd.org> Sender: source-changes-owner@NetBSD.org List-Id: source-changes.NetBSD.org Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Roy Marples" Mail-Followup-To: source-changes-d@NetBSD.org Module Name: src Committed By: roy Date: Sun Jan 29 18:33:07 UTC 2012 Modified Files: src/sys/sys: socket.h Log Message: Allow using CMSG_NXTHDR with -Wcast-align. If various checks are omitted, the CMSG_NXTHDR macro expands to (struct cmsghdr *)((char *)(cmsg) + \ _ALIGN(((struct cmsghdr *)(cmsg))->cmsg_len)) Although there is no alignment problem (assuming cmsg is properly aligned and _ALIGN is correct), this violates -Wcast-align on strict-alignment architectures. Therefore an intermediate cast to void * is appropriate here. There is no workaround other than not using -Wcast-align. Taken from FreeBSD commit r220742 by jilles To generate a diff of this commit: cvs rdiff -u -r1.105 -r1.106 src/sys/sys/socket.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.