From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLGkC-0002a6-OA for qemu-devel@nongnu.org; Mon, 18 Jan 2016 15:49:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLGkB-0000eE-Mu for qemu-devel@nongnu.org; Mon, 18 Jan 2016 15:49:44 -0500 Received: from mail-vk0-x22e.google.com ([2607:f8b0:400c:c05::22e]:33948) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLGkB-0000e8-Fw for qemu-devel@nongnu.org; Mon, 18 Jan 2016 15:49:43 -0500 Received: by mail-vk0-x22e.google.com with SMTP id a123so308170054vkh.1 for ; Mon, 18 Jan 2016 12:49:43 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <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> <82CB3A8D-1061-48FF-9236-C09A54B5DC68@gmail.com> From: Peter Maydell Date: Mon, 18 Jan 2016 20:49:23 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: Programmingkid Cc: Paolo Bonzini , qemu-devel qemu-devel On 18 January 2016 at 19:50, Programmingkid wro= te: > 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)) + ((__da= rwin_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 }; No, the problem is that the compiler seems to think the bit in [] is not compile time constant (the =3D { 0 } initializer syntax is valid if and only if it is compile-time-constant). Can you say what 'gcc --version' prints for you? That will tell us the clang version number, which is more interesting than what clang claims its gcc-compatibility is. I'm leaning towards this being a compiler bug fixed in a later version of clang, because that [] expression looks like it should be constant to me, and it's constant as far as my clang version thinks. thanks -- PMM