* [Qemu-devel] [PATCH] #include cleanliness
@ 2011-05-19 14:17 Avi Kivity
2011-05-29 16:30 ` Avi Kivity
2011-05-29 22:06 ` Anthony Liguori
0 siblings, 2 replies; 5+ messages in thread
From: Avi Kivity @ 2011-05-19 14:17 UTC (permalink / raw)
To: qemu-devel
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>
+
#if !defined(CONFIG_USER_ONLY)
enum device_endian {
diff --git a/targphys.h b/targphys.h
index 95648d6..501add2 100644
--- a/targphys.h
+++ b/targphys.h
@@ -3,6 +3,8 @@
#ifndef TARGPHYS_H
#define TARGPHYS_H
+#include <stdint.h>
+
#ifdef TARGET_PHYS_ADDR_BITS
/* target_phys_addr_t is the type of a physical address (its size can
be different from 'target_ulong'). */
--
1.7.5.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] #include cleanliness
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
1 sibling, 0 replies; 5+ messages in thread
From: Avi Kivity @ 2011-05-29 16:30 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Hajnoczi
On 05/19/2011 05:17 PM, 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.
Can some qemu maintainer review this patch? Stefan?
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] #include cleanliness
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
1 sibling, 1 reply; 5+ messages in thread
From: Anthony Liguori @ 2011-05-29 22:06 UTC (permalink / raw)
To: Avi Kivity; +Cc: qemu-devel
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.
Regards,
Anthony Liguori
> +
> #if !defined(CONFIG_USER_ONLY)
>
> enum device_endian {
> diff --git a/targphys.h b/targphys.h
> index 95648d6..501add2 100644
> --- a/targphys.h
> +++ b/targphys.h
> @@ -3,6 +3,8 @@
> #ifndef TARGPHYS_H
> #define TARGPHYS_H
>
> +#include<stdint.h>
> +
> #ifdef TARGET_PHYS_ADDR_BITS
> /* target_phys_addr_t is the type of a physical address (its size can
> be different from 'target_ulong'). */
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] #include cleanliness
2011-05-29 22:06 ` Anthony Liguori
@ 2011-05-30 9:06 ` Avi Kivity
2011-05-31 13:43 ` Anthony Liguori
0 siblings, 1 reply; 5+ messages in thread
From: Avi Kivity @ 2011-05-30 9:06 UTC (permalink / raw)
To: Anthony Liguori; +Cc: qemu-devel
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...
I think osdep.h matches the "help with portability" label better, no?
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] #include cleanliness
2011-05-30 9:06 ` Avi Kivity
@ 2011-05-31 13:43 ` Anthony Liguori
0 siblings, 0 replies; 5+ messages in thread
From: Anthony Liguori @ 2011-05-31 13:43 UTC (permalink / raw)
To: Avi Kivity; +Cc: qemu-devel
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-05-31 13:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.