From: Markus Armbruster <armbru@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] QEMU_BUILD_BUG_ON: use __COUNTER__
Date: Tue, 31 Jan 2017 19:43:31 +0100 [thread overview]
Message-ID: <87k29boyss.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20170131165052.GD20303@redhat.com> (Daniel P. Berrange's message of "Tue, 31 Jan 2017 16:50:52 +0000")
"Daniel P. Berrange" <berrange@redhat.com> writes:
> On Tue, Jan 31, 2017 at 04:43:52PM +0200, Michael S. Tsirkin wrote:
>> Some headers use QEMU_BUILD_BUG_ON. This causes a problem
>> if the C file including that header happens to have
>> QEMU_BUILD_BUG_ON at the same line number.
>
> Do we actually hit this problem in practice ? Even if we do hit the
> problem, it surely has a trivial workaround of just inserting/removing
> a blank line somewhere in the file before the QEMU_BUILD_BUG_ON.
>
> IOW, is it really a benefit to change to use COUNTER, given that it is
> less portable that what we have today ?
__COUNTER__ is the best solution I've seen so far.
The proposed fallback for compilers lacking __COUNTER__ is not quite
correct, but it's relatively unlikely to break, and I'm vanishingly
unlikely to compile with such an old compiler ever again, so I'm okay
with it. I'd also be okay with making __COUNTER__ support a hard
requirement.
I guess that means:
Reviewed-by: Markus Armbruster <armbru@redhat.com>
next prev parent reply other threads:[~2017-01-31 18:43 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-31 14:43 [Qemu-devel] [PATCH] QEMU_BUILD_BUG_ON: use __COUNTER__ Michael S. Tsirkin
2017-01-31 15:02 ` Peter Maydell
2017-01-31 15:03 ` Eric Blake
2017-01-31 15:12 ` Peter Maydell
2017-01-31 15:16 ` Eric Blake
2017-01-31 15:26 ` Peter Maydell
2017-01-31 15:28 ` Paolo Bonzini
2017-01-31 16:17 ` Peter Maydell
2017-01-31 15:34 ` Markus Armbruster
2017-01-31 17:58 ` Michael S. Tsirkin
2017-01-31 15:26 ` Markus Armbruster
2017-01-31 15:29 ` Michael S. Tsirkin
2017-01-31 16:07 ` Markus Armbruster
2017-01-31 16:37 ` Eric Blake
2017-01-31 16:54 ` Peter Maydell
2017-01-31 15:47 ` Peter Maydell
2017-01-31 16:50 ` Daniel P. Berrange
2017-01-31 17:56 ` Michael S. Tsirkin
2017-01-31 18:43 ` Markus Armbruster [this message]
2017-01-31 18:58 ` Eric Blake
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=87k29boyss.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.