qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Programmingkid <programmingkidx@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] CMSG_SPACE() causing compile time error on Mac OS X
Date: Mon, 18 Jan 2016 20:49:23 +0000	[thread overview]
Message-ID: <CAFEAcA_vQtww+mG6DMNfBBsSBjJ9854E2P9oxWWzLHTqfrAz2g@mail.gmail.com> (raw)
In-Reply-To: <82CB3A8D-1061-48FF-9236-C09A54B5DC68@gmail.com>

On 18 January 2016 at 19:50, Programmingkid <programmingkidx@gmail.com> 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	other threads:[~2016-01-18 20:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-17 22:23 [Qemu-devel] CMSG_SPACE() causing compile time error on Mac OS X Programmingkid
2016-01-17 23:22 ` Paolo Bonzini
2016-01-17 23:45   ` Programmingkid
2016-01-18 17:45     ` Eric Blake
2016-01-18 17:59       ` Peter Maydell
2016-01-18 19:46         ` Programmingkid
2016-01-18 19:50       ` Programmingkid
2016-01-18 20:49         ` Peter Maydell [this message]
2016-01-18 21:09           ` Programmingkid
2016-01-18 22:09             ` Peter Maydell
2016-01-19  1:23               ` Programmingkid
2016-01-19 23:49                 ` Programmingkid
2016-01-18  9:58 ` Daniel P. Berrange
2016-01-18 14:36   ` Programmingkid
2016-01-19 14:06     ` Daniel P. Berrange

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFEAcA_vQtww+mG6DMNfBBsSBjJ9854E2P9oxWWzLHTqfrAz2g@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=programmingkidx@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).