[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: |
Programmingkid |
Subject: |
Re: [Qemu-devel] CMSG_SPACE() causing compile time error on Mac OS X |
Date: |
Mon, 18 Jan 2016 14:50:36 -0500 |
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?
>>>
>>> Paolo
>>
>> #define CMSG_SPACE(l) (__DARWIN_ALIGN32(sizeof(struct
>> cmsghdr)) + __DARWIN_ALIGN32(l))
>
> And the definition of __DARWIN_ALIGN32()?
>
> 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)))] = { 0 };
It looks like the problem was actually with this part: = { 0 };
- [Qemu-devel] CMSG_SPACE() causing compile time error on Mac OS X, Programmingkid, 2016/01/17
- Re: [Qemu-devel] CMSG_SPACE() causing compile time error on Mac OS X, Paolo Bonzini, 2016/01/17
- Re: [Qemu-devel] CMSG_SPACE() causing compile time error on Mac OS X, Programmingkid, 2016/01/17
- Re: [Qemu-devel] CMSG_SPACE() causing compile time error on Mac OS X,
Programmingkid <=
- Re: [Qemu-devel] CMSG_SPACE() causing compile time error on Mac OS X, Peter Maydell, 2016/01/18
- Re: [Qemu-devel] CMSG_SPACE() causing compile time error on Mac OS X, Programmingkid, 2016/01/18
- Re: [Qemu-devel] CMSG_SPACE() causing compile time error on Mac OS X, Peter Maydell, 2016/01/18
- Re: [Qemu-devel] CMSG_SPACE() causing compile time error on Mac OS X, Programmingkid, 2016/01/18
- Re: [Qemu-devel] CMSG_SPACE() causing compile time error on Mac OS X, Programmingkid, 2016/01/19
Re: [Qemu-devel] CMSG_SPACE() causing compile time error on Mac OS X, Daniel P. Berrange, 2016/01/18