qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] When to use qemu/typedefs.h (was: [PATCH 23/28] numa: D


From: Paolo Bonzini
Subject: Re: [Qemu-devel] When to use qemu/typedefs.h (was: [PATCH 23/28] numa: Don't include hw/boards.h into sysemu/numa.h)
Date: Tue, 30 Jul 2019 15:28:57 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 30/07/19 15:15, Eric Blake wrote:
>> We occasionally give up and use types directly rather than their typedef
>> names, flouting the coding style.  This patch does.  Trades messing with
>> qemu/typedefs.h for having to write 'struct' a few times.

I think Markus made the right call here.  Using "struct Foo;" in headers
is a null price to pay if all you need is declaring a pointer-typed
field or parameter.  Of course this doesn't apply if you have to embed a
struct directly, but then qemu/typedefs.h wouldn't help either.

In general unless you're adding a new subsystem, qemu/typedefs.h should
only decrease in size, never increase.  (And there are certainly many
cases where typedefs.h are not needed, but cleaning that up is
understandably not high on the todo list).

Paolo



reply via email to

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