qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Avi Kivity <avi@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH]  #include cleanliness
Date: Tue, 31 May 2011 08:43:48 -0500	[thread overview]
Message-ID: <4DE4F094.201@codemonkey.ws> (raw)
In-Reply-To: <4DE35DFD.600@redhat.com>

On 05/30/2011 04:06 AM, Avi Kivity wrote:
> On 05/30/2011 01:06 AM, Anthony Liguori wrote:
>> On 05/19/2011 09:17 AM, Avi Kivity wrote:
>>> My mother always told me to explicitly #include any headers need to
>>> compile
>>> a file, instead of relying on other #includes to bring them in. This
>>> patch
>>> fixes up targphys.h and cpu-common.h in this regard.
>>>
>>> Signed-off-by: Avi Kivity<avi@redhat.com>
>>> ---
>>> cpu-common.h | 4 ++++
>>> targphys.h | 2 ++
>>> 2 files changed, 6 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/cpu-common.h b/cpu-common.h
>>> index 151c32c..2009adc 100644
>>> --- a/cpu-common.h
>>> +++ b/cpu-common.h
>>> @@ -18,6 +18,10 @@
>>> #include "bswap.h"
>>> #include "qemu-queue.h"
>>>
>>> +#include "qemu-common.h"
>>> +
>>> +#include<stdbool.h>
>>
>> qemu-common.h should include stdbool.
>>
>> The idea behind qemu-common.h is to avoid direct includes to help with
>> portability.
>
> Okay. But note qemu-common.h #includes cpu.h #includes qemu-common.h...

Fortunately, guards will prevent infinite recursion here :-)

> I think osdep.h matches the "help with portability" label better, no?

I don't disagree, but that's not the purpose of osdep.h today. 
qemu-common.h is a header file that's more or less supposed to be 
included by everything.

It should prevent explicit #include's for system headers.

Regards,

Anthony Liguori

      reply	other threads:[~2011-05-31 13:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-19 14:17 [Qemu-devel] [PATCH] #include cleanliness Avi Kivity
2011-05-29 16:30 ` Avi Kivity
2011-05-29 22:06 ` Anthony Liguori
2011-05-30  9:06   ` Avi Kivity
2011-05-31 13:43     ` Anthony Liguori [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DE4F094.201@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=avi@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).