From: Markus Armbruster <armbru@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
QEMU Developers <qemu-devel@nongnu.org>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH RFC 4/5] include: Move typedef qemu_irq to qemu/typedefs.h
Date: Fri, 24 Jun 2016 15:43:39 +0200 [thread overview]
Message-ID: <87wpleitx0.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <CAFEAcA8dkKfS=Yo-2bK-dJOWKVCTW58_h4tViewAQrrEHYH_dw@mail.gmail.com> (Peter Maydell's message of "Fri, 24 Jun 2016 13:45:08 +0100")
Peter Maydell <peter.maydell@linaro.org> writes:
> On 24 June 2016 at 13:32, Markus Armbruster <armbru@redhat.com> wrote:
>> Peter Maydell <peter.maydell@linaro.org> writes:
>>> It would still be different by being a pointer-to-Foo, not a Foo.
>>
>> Hiding pointer-ness behind a typedef is a bad idea more often than not.
>>
>> What do you want me to do, if anything?
>
> I think my underlying issue is that the purpose of typedefs.h
> (as I see it) is to define some typedefs for handing around
> pointers to opaque objects, but we don't pass around pointers
> to qemu_irqs, we pass around actual qemu_irqs. So I don't
> really feel like it belongs in this header.
My view of typedefs.h is more pragmatic: it's for breaking inclusion
cycles at an arc where we get a complete type from FOO.h, but only need
an incomplete one: declare the incomplete type in typedefs.h, complete
it in FOO.h, drop inclusions of FOO.h that don't need the complete type.
Can also be done by creating a FOO-abstract.h that declares the
incomplete type and whatever else makes sense. Overkill when "whatever
else" is empty, which it often is.
Dropping inclusions that are just for the incomplete can also speed up
compilation.
If you really don't want qemu_irq in typedefs.h, where should it go?
next prev parent reply other threads:[~2016-06-24 13:43 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-23 16:12 [Qemu-devel] [PATCH RFC 0/5] Baby steps towards saner headers Markus Armbruster
2016-06-23 16:12 ` [Qemu-devel] [PATCH RFC 1/5] Use #include "..." exactly for our own headers Markus Armbruster
2016-06-23 16:31 ` Peter Maydell
2016-06-23 16:12 ` [Qemu-devel] [PATCH RFC 2/5] tests: New make target check-headers Markus Armbruster
2016-06-23 16:40 ` Paolo Bonzini
2016-06-23 16:47 ` Peter Maydell
2016-06-24 8:10 ` Markus Armbruster
2016-06-23 19:33 ` Eric Blake
2016-06-24 8:11 ` Markus Armbruster
2016-06-23 16:12 ` [Qemu-devel] [PATCH RFC 3/5] include/qemu/typedefs.h: Restore alphabetical order Markus Armbruster
2016-06-23 16:40 ` Peter Maydell
2016-06-24 8:11 ` Markus Armbruster
2016-06-23 16:12 ` [Qemu-devel] [PATCH RFC 4/5] include: Move typedef qemu_irq to qemu/typedefs.h Markus Armbruster
2016-06-23 16:41 ` Peter Maydell
2016-06-24 8:12 ` Markus Armbruster
2016-06-24 8:15 ` Peter Maydell
2016-06-24 8:17 ` Paolo Bonzini
2016-06-24 9:46 ` Peter Maydell
2016-06-24 12:32 ` Markus Armbruster
2016-06-24 12:45 ` Peter Maydell
2016-06-24 13:43 ` Markus Armbruster [this message]
2016-06-24 13:45 ` Peter Maydell
2016-06-23 16:12 ` [Qemu-devel] [PATCH RFC 5/5] include: Include exec/hwaddr.h where hwaddr is used Markus Armbruster
2016-06-24 8:17 ` Markus Armbruster
2016-06-24 8:18 ` Paolo Bonzini
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=87wpleitx0.fsf@dusky.pond.sub.org \
--to=armbru@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 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).