Received: from eggs.gnu.org ([2001:4830:134:3::10]:37033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLFp5-0006qx-Bm for qemu-devel@nongnu.org; Mon, 18 Jan 2016 14:50:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLFp2-0002kW-5t for qemu-devel@nongnu.org; Mon, 18 Jan 2016 14:50:43 -0500 Received: from mail-io0-x232.google.com ([2607:f8b0:4001:c06::232]:34468) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLFp2-0002kS-0M for qemu-devel@nongnu.org; Mon, 18 Jan 2016 14:50:40 -0500 Received: by mail-io0-x232.google.com with SMTP id 1so512305057ion.1 for ; Mon, 18 Jan 2016 11:50:39 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Programmingkid In-Reply-To: <569D24D2.3000800@redhat.com> Date: Mon, 18 Jan 2016 14:50:36 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <82CB3A8D-1061-48FF-9236-C09A54B5DC68@gmail.com> References: <5525054B-A7E2-4538-9F68-9E606B85B1B7@gmail.com> <569C224B.2040102@redhat.com> <1866CB23-7966-4F68-8925-2C3888753883@gmail.com> <569D24D2.3000800@redhat.com> Subject: Re: [Qemu-devel] CMSG_SPACE() causing compile time error on Mac OS X List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , Peter Maydell , Paolo Bonzini Cc: qemu-devel qemu-devel On Jan 18, 2016, at 12:45 PM, Eric Blake wrote: > On 01/17/2016 04:45 PM, Programmingkid wrote: >>> What's the definition of the CMSG_SPACE macro under OS X? >>>=20 >>> Paolo >>=20 >> #define CMSG_SPACE(l) (__DARWIN_ALIGN32(sizeof(struct = cmsghdr)) + __DARWIN_ALIGN32(l)) >=20 > And the definition of __DARWIN_ALIGN32()? >=20 > It looks like the definition is not properly resulting in a = compile-time > constant, and therefore the warning about the initializer is resulting > because you can't initialize a dynamically-sized array. But you still > haven't shown us why the headers are resulting in a non-constant size. I tried what Peter Maydell did and here are the results: typedef __darwin_size_t size_t; char control[(((__darwin_size_t)((char *)(__darwin_size_t)(sizeof(struct = cmsghdr)) + (sizeof(__uint32_t) - 1)) &~ (sizeof(__uint32_t) - 1)) + = ((__darwin_size_t)((char *)(__darwin_size_t)(sizeof(int) * 16) + = (sizeof(__uint32_t) - 1)) &~ (sizeof(__uint32_t) - 1)))] =3D { 0 }; It looks like the problem was actually with this part: =3D { 0 };