From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGROe-0002oh-59 for qemu-devel@nongnu.org; Fri, 24 Jun 2016 09:43:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGROY-0004Pa-Ao for qemu-devel@nongnu.org; Fri, 24 Jun 2016 09:43:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57831) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGROY-0004PW-5L for qemu-devel@nongnu.org; Fri, 24 Jun 2016 09:43:42 -0400 From: Markus Armbruster References: <1466698330-6021-1-git-send-email-armbru@redhat.com> <1466698330-6021-5-git-send-email-armbru@redhat.com> <87oa6rxax1.fsf@dusky.pond.sub.org> <213da4da-cc47-e0a2-c90d-dac2f8ca911f@redhat.com> <8760sylqcz.fsf@dusky.pond.sub.org> Date: Fri, 24 Jun 2016 15:43:39 +0200 In-Reply-To: (Peter Maydell's message of "Fri, 24 Jun 2016 13:45:08 +0100") Message-ID: <87wpleitx0.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH RFC 4/5] include: Move typedef qemu_irq to qemu/typedefs.h List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Paolo Bonzini , QEMU Developers , "Michael S. Tsirkin" Peter Maydell writes: > On 24 June 2016 at 13:32, Markus Armbruster wrote: >> Peter Maydell 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?