From: "Jan Beulich" Subject: Re: [PATCH v3 1/5] hypervisor/arm/keyhandler: Declare struct cpu_user_regs; Date: Fri, 12 Feb 2016 07:53:33 -0700 Message-ID: <56BDFFFD02000078000D16F9@prv-mh.provo.novell.com> References: <1455246507-5589-1-git-send-email-konrad.wilk@oracle.com> <1455246507-5589-2-git-send-email-konrad.wilk@oracle.com> <56BDDC2E02000078000D1647@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aUF6J-0001j0-RO for xen-devel@lists.xenproject.org; Fri, 12 Feb 2016 14:53:39 +0000 In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: wei.liu2@citrix.com, ian.campbell@citrix.com, ian.jackson@eu.citrix.com, stefano.stabellini@citrix.com, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org >>> On 12.02.16 at 13:46, wrote: > On Fri, 12 Feb 2016, Jan Beulich wrote: >> and then this is the "include everything everywhere" attitude >> which tends to needlessly slow down builds (avoiding the need >> to include everything everywhere is actually one of the >> purposes of such forward declarations, which allows going as >> far as having the full definition in just a single source file). > > Fair enough, but keyhandler.h directly uses struct cpu_user_regs as > parameter in two functions, so I think it would be right to include an > header file with the definition. No, full definitions need only be visible when structure instances are used, not when just pointers to them get declared. The sole reason why the forward declaration is needed is because otherwise declaration and definition of the function wouldn't match, as without the forward declaration the scope of the structure is that of the function (instead of the global scope). Jan