qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] CMSG_SPACE() causing compile time error on Mac OS X


From: Peter Maydell
Subject: Re: [Qemu-devel] CMSG_SPACE() causing compile time error on Mac OS X
Date: Mon, 18 Jan 2016 20:49:23 +0000

On 18 January 2016 at 19:50, Programmingkid <address@hidden> wrote:
> 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)))] = { 0 };
>
> It looks like the problem was actually with this part: = { 0 };

No, the problem is that the compiler seems to think the bit in []
is not compile time constant (the = { 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]