All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Patch Tracking" <patches@linaro.org>,
	"Alexander Graf" <agraf@suse.de>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Blue Swirl" <blauwirbel@gmail.com>,
	"Claudio Fontana" <claudio.fontana@linaro.org>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"Anthony Liguori" <aliguori@amazon.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
	"Christoffer Dall" <christoffer.dall@linaro.org>,
	"Richard Henderson" <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH 0/4] disas: add libvixl to support A64 disassembly
Date: Wed, 08 Jan 2014 07:55:49 +0100	[thread overview]
Message-ID: <52CCF675.6090504@weilnetz.de> (raw)
In-Reply-To: <CAFEAcA8OgaqU+X_bhRnCSG5WvXLFa8nQPpTyND8m6SecjHqEGg@mail.gmail.com>

Am 08.01.2014 00:00, schrieb Peter Maydell:
> On 7 January 2014 22:30, Stefan Weil <sw@weilnetz.de> wrote:
>
>> I'd prefer one file disas/aarch64.cc instead of these two files:
>>
>>  disas/aarch64-cxx.cc        |   80
>> +++++++++++++++++++++++++++++++++++++++++++
>>  disas/aarch64.c             |   39 +++++++++++++++++++++
>>
>> This would also allow removing the extern statement in the C++ code (and
>> use a local function).
> See the comment in aarch64-cxx.cc -- to do that we'd need to
> make sure bfd.h was valid for C++ as well as C compilation. This
> came up when Andreas reviewed the RFC and that was Claudio's
> explanation for the split, which is why I added the comment.
>
> Claudio -- do you recall what the exact issue here is?
>
> Specifically, I think the problem is that if we put print_insn_aarch64()
> in the C++ file then we need to have its prototype in bfd.h guarded
> with "extern C {}" if (and only if) we're compiling a C++ file. If
> you care about restricting the C++-isms to the C++ files that's
> a bit ugly. But we could do that if people prefer.
>
> Some experimentation suggests it would also be possible to
> just do
>
> extern "C" {
> #include "disas/bfd.h"
> }
>
> in the C++ file. If that doesn't have any hidden gotchas I don't
> know about it looks like the nicest solution.
>

Adding the extern "C" to include/disas/bfd.h would be even better. It
might be possible to use the glib macros G_BEGIN_DECLS and G_END_DECLSor
__BEGIN_DECLS and __END_DECLS from the C library for this purpose.

Stefan

  reply	other threads:[~2014-01-08  6:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07 16:51 [Qemu-devel] [PATCH 0/4] disas: add libvixl to support A64 disassembly Peter Maydell
2014-01-07 16:51 ` [Qemu-devel] [PATCH 1/4] rules.mak: Support .cc as a C++ source file suffix Peter Maydell
2014-01-07 16:51 ` [Qemu-devel] [PATCH 2/4] rules.mak: Link with C++ if we have a C++ compiler Peter Maydell
2014-01-07 16:51 ` [Qemu-devel] [PATCH 3/4] disas: add libvixl source code for AArch64 A64 disassembler Peter Maydell
2014-01-07 16:51 ` [Qemu-devel] [PATCH 4/4] disas: Implement disassembly output for A64 Peter Maydell
2014-01-07 22:30 ` [Qemu-devel] [PATCH 0/4] disas: add libvixl to support A64 disassembly Stefan Weil
2014-01-07 23:00   ` Peter Maydell
2014-01-08  6:55     ` Stefan Weil [this message]
2014-01-08 10:07       ` Peter Maydell
2014-01-07 22:53 ` Stefan Weil
2014-01-08 14:51   ` Alex Bennée
2014-01-08 15:31     ` Peter Maydell
2014-01-08 16:19       ` Alexander Graf
2014-01-07 23:46 ` Peter Maydell
2014-01-08 14:48   ` Alex Bennée

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=52CCF675.6090504@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=agraf@suse.de \
    --cc=alex.bennee@linaro.org \
    --cc=aliguori@amazon.com \
    --cc=aurelien@aurel32.net \
    --cc=blauwirbel@gmail.com \
    --cc=christoffer.dall@linaro.org \
    --cc=claudio.fontana@linaro.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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.