* [Qemu-devel] [PATCH] Error: Fix build when qemu-common.h is not included
@ 2011-07-07 16:02 Luiz Capitulino
2011-07-07 16:17 ` Michael Roth
0 siblings, 1 reply; 4+ messages in thread
From: Luiz Capitulino @ 2011-07-07 16:02 UTC (permalink / raw)
To: qemu-devel; +Cc: mdroth
Commit e4ea5e2d0e0e4c5188ab45b66f3195062ae059dc added the use of
the macro GCC_FMT_ATTR to error.h, however qemu-common.h is not
included by error.h
This will cause a build error when files including error.h
don't include qemu-common.h. Not an issue today because the only
file including it is json-parser.h and it does include
qemu-common.h, but let's fix it.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
error.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/error.h b/error.h
index 0f92a6f..6e3bd98 100644
--- a/error.h
+++ b/error.h
@@ -12,7 +12,7 @@
#ifndef ERROR_H
#define ERROR_H
-#include <stdbool.h>
+#include "qemu-common.h"
/**
* A class representing internal errors within QEMU. An error has a string
--
1.7.6.134.gcf13f
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] Error: Fix build when qemu-common.h is not included
2011-07-07 16:02 [Qemu-devel] [PATCH] Error: Fix build when qemu-common.h is not included Luiz Capitulino
@ 2011-07-07 16:17 ` Michael Roth
2011-07-07 16:50 ` Stefan Weil
0 siblings, 1 reply; 4+ messages in thread
From: Michael Roth @ 2011-07-07 16:17 UTC (permalink / raw)
To: Luiz Capitulino; +Cc: qemu-devel
On 07/07/2011 11:02 AM, Luiz Capitulino wrote:
> Commit e4ea5e2d0e0e4c5188ab45b66f3195062ae059dc added the use of
> the macro GCC_FMT_ATTR to error.h, however qemu-common.h is not
> included by error.h
>
> This will cause a build error when files including error.h
> don't include qemu-common.h. Not an issue today because the only
> file including it is json-parser.h and it does include
> qemu-common.h, but let's fix it.
>
> Signed-off-by: Luiz Capitulino<lcapitulino@redhat.com>
> ---
> error.h | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/error.h b/error.h
> index 0f92a6f..6e3bd98 100644
> --- a/error.h
> +++ b/error.h
> @@ -12,7 +12,7 @@
> #ifndef ERROR_H
> #define ERROR_H
>
> -#include<stdbool.h>
> +#include "qemu-common.h"
>
> /**
> * A class representing internal errors within QEMU. An error has a string
Tested-by: Michael Roth <mdroth@linux.vnet.ibm.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] Error: Fix build when qemu-common.h is not included
2011-07-07 16:17 ` Michael Roth
@ 2011-07-07 16:50 ` Stefan Weil
2011-07-07 17:32 ` Luiz Capitulino
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Weil @ 2011-07-07 16:50 UTC (permalink / raw)
To: Luiz Capitulino; +Cc: Michael Roth, qemu-devel
Am 07.07.2011 18:17, schrieb Michael Roth:
> On 07/07/2011 11:02 AM, Luiz Capitulino wrote:
>> Commit e4ea5e2d0e0e4c5188ab45b66f3195062ae059dc added the use of
>> the macro GCC_FMT_ATTR to error.h, however qemu-common.h is not
>> included by error.h
>>
>> This will cause a build error when files including error.h
>> don't include qemu-common.h. Not an issue today because the only
>> file including it is json-parser.h and it does include
>> qemu-common.h, but let's fix it.
>>
>> Signed-off-by: Luiz Capitulino<lcapitulino@redhat.com>
>> ---
>> error.h | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
The same argument could be applied to more QEMU *.h files
which also work only after qemu-common.h. Otherwise, including
qemu-common.h in *.c files would rarely be needed.
As far as I remember, the *.h files used to be more self-contained
some years ago, but then the strategy changed and central files
like qemu-common.h were introduced.
I personally prefer self-contained include files like error.h
(before my patch and after your patch), but I'm afraid that
the QEMU way is different.
Cheers,
Stefan W.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] Error: Fix build when qemu-common.h is not included
2011-07-07 16:50 ` Stefan Weil
@ 2011-07-07 17:32 ` Luiz Capitulino
0 siblings, 0 replies; 4+ messages in thread
From: Luiz Capitulino @ 2011-07-07 17:32 UTC (permalink / raw)
To: Stefan Weil; +Cc: Michael Roth, qemu-devel
On Thu, 07 Jul 2011 18:50:28 +0200
Stefan Weil <weil@mail.berlios.de> wrote:
> Am 07.07.2011 18:17, schrieb Michael Roth:
> > On 07/07/2011 11:02 AM, Luiz Capitulino wrote:
> >> Commit e4ea5e2d0e0e4c5188ab45b66f3195062ae059dc added the use of
> >> the macro GCC_FMT_ATTR to error.h, however qemu-common.h is not
> >> included by error.h
> >>
> >> This will cause a build error when files including error.h
> >> don't include qemu-common.h. Not an issue today because the only
> >> file including it is json-parser.h and it does include
> >> qemu-common.h, but let's fix it.
> >>
> >> Signed-off-by: Luiz Capitulino<lcapitulino@redhat.com>
> >> ---
> >> error.h | 2 +-
> >> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> The same argument could be applied to more QEMU *.h files
> which also work only after qemu-common.h. Otherwise, including
> qemu-common.h in *.c files would rarely be needed.
>
> As far as I remember, the *.h files used to be more self-contained
> some years ago, but then the strategy changed and central files
> like qemu-common.h were introduced.
>
> I personally prefer self-contained include files like error.h
> (before my patch and after your patch), but I'm afraid that
> the QEMU way is different.
The current way is broken. Some qemu header files are a complete mess.
qemu-common.h and sysemu.h are good examples. They include too many
things, if you change them a lot of code will be recompiled.
I could make the problem less worse by moving all compiler related
macros to a compiler.h header and then include it in qemu-common.h
and error.h. This way error.h won't be affected, although the real
problem will remain unsolved.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-07-07 17:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-07 16:02 [Qemu-devel] [PATCH] Error: Fix build when qemu-common.h is not included Luiz Capitulino
2011-07-07 16:17 ` Michael Roth
2011-07-07 16:50 ` Stefan Weil
2011-07-07 17:32 ` Luiz Capitulino
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).