qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC] HACKING: Document 'struct' keyword usage


From: Eric Blake
Subject: Re: [Qemu-devel] [RFC] HACKING: Document 'struct' keyword usage
Date: Tue, 30 Jul 2019 16:32:29 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0

On 7/30/19 4:07 PM, Eduardo Habkost wrote:
> Sometimes we use the 'struct' keyword to help us reduce
> dependencies between header files.  Document that practice.
> 
> Signed-off-by: Eduardo Habkost <address@hidden>
> ---
> I wonder if this is too terse?  Should we give examples?

An example might be nice, but I like the wording - it makes it obvious
that the header uses 'struct' but the .c should use the typedef.

> ---
>  HACKING | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/HACKING b/HACKING
> index 0fc3e0fc04..112685bdaf 100644
> --- a/HACKING
> +++ b/HACKING
> @@ -101,6 +101,8 @@ it points to, or it is aliased to another pointer that is.
>  
>  2.3. Typedefs
>  Typedefs are used to eliminate the redundant 'struct' keyword.
> +However, the 'struct' keyword may be sometimes used in header
> +files to avoid unnecessary dependencies between headers.


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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