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

Re: [Xen-devel] [PATCH v3 1/5] hypervisor/arm/keyhandler: Declare struct cpu_user_regs;



>>> On 12.02.16 at 13:46, <stefano.stabellini@xxxxxxxxxxxxx> 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


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.