[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC 4/5] include: Move typedef qemu_irq to qemu/

From: Markus Armbruster
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Peter Maydell <address@hidden> writes:

> On 24 June 2016 at 13:32, Markus Armbruster <address@hidden> wrote:
>> Peter Maydell <address@hidden> 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

If you really don't want qemu_irq in typedefs.h, where should it go?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]