qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ppc/pnv: fix compile breakage on old gcc
@ 2016-11-07 18:03 Cédric Le Goater
  2016-11-07 23:36 ` David Gibson
  0 siblings, 1 reply; 2+ messages in thread
From: Cédric Le Goater @ 2016-11-07 18:03 UTC (permalink / raw)
  To: qemu-ppc; +Cc: David Gibson, qemu-devel, Olaf Hering, Cédric Le Goater

PnvChip is defined twice and this can confuse old compilers :

  CC      ppc64-softmmu/hw/ppc/pnv_xscom.o
In file included from qemu.git/hw/ppc/pnv.c:29:
qemu.git/include/hw/ppc/pnv.h:60: error: redefinition of typedef ‘PnvChip’
qemu.git/include/hw/ppc/pnv_xscom.h:24: note: previous declaration of ‘PnvChip’ was here
make[1]: *** [hw/ppc/pnv.o] Error 1
make[1]: *** Waiting for unfinished jobs....

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---

 Tested with gcc version 4.4.7 20120313

 hw/ppc/pnv_core.c          | 1 +
 hw/ppc/pnv_lpc.c           | 3 ++-
 hw/ppc/pnv_xscom.c         | 2 +-
 include/hw/ppc/pnv.h       | 1 -
 include/hw/ppc/pnv_xscom.h | 2 --
 5 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/hw/ppc/pnv_core.c b/hw/ppc/pnv_core.c
index 2acda9637db5..76ce854b0c40 100644
--- a/hw/ppc/pnv_core.c
+++ b/hw/ppc/pnv_core.c
@@ -24,6 +24,7 @@
 #include "hw/ppc/ppc.h"
 #include "hw/ppc/pnv.h"
 #include "hw/ppc/pnv_core.h"
+#include "hw/ppc/pnv_xscom.h"
 
 static void powernv_cpu_reset(void *opaque)
 {
diff --git a/hw/ppc/pnv_lpc.c b/hw/ppc/pnv_lpc.c
index 00dbd8b07b38..0e2117f0f5bc 100644
--- a/hw/ppc/pnv_lpc.c
+++ b/hw/ppc/pnv_lpc.c
@@ -23,8 +23,9 @@
 #include "qapi/error.h"
 #include "qemu/log.h"
 
-#include "hw/ppc/pnv_lpc.h"
 #include "hw/ppc/pnv.h"
+#include "hw/ppc/pnv_lpc.h"
+#include "hw/ppc/pnv_xscom.h"
 #include "hw/ppc/fdt.h"
 
 #include <libfdt.h>
diff --git a/hw/ppc/pnv_xscom.c b/hw/ppc/pnv_xscom.c
index 5aaa264bd75c..f46646141a96 100644
--- a/hw/ppc/pnv_xscom.c
+++ b/hw/ppc/pnv_xscom.c
@@ -25,8 +25,8 @@
 #include "hw/sysbus.h"
 
 #include "hw/ppc/fdt.h"
-#include "hw/ppc/pnv_xscom.h"
 #include "hw/ppc/pnv.h"
+#include "hw/ppc/pnv_xscom.h"
 
 #include <libfdt.h>
 
diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h
index 02ac1c5f428e..7bee658733db 100644
--- a/include/hw/ppc/pnv.h
+++ b/include/hw/ppc/pnv.h
@@ -21,7 +21,6 @@
 
 #include "hw/boards.h"
 #include "hw/sysbus.h"
-#include "hw/ppc/pnv_xscom.h"
 #include "hw/ppc/pnv_lpc.h"
 
 #define TYPE_PNV_CHIP "powernv-chip"
diff --git a/include/hw/ppc/pnv_xscom.h b/include/hw/ppc/pnv_xscom.h
index c0a2fbb9f6f8..41a5127a1907 100644
--- a/include/hw/ppc/pnv_xscom.h
+++ b/include/hw/ppc/pnv_xscom.h
@@ -21,8 +21,6 @@
 
 #include "qom/object.h"
 
-typedef struct PnvChip PnvChip;
-
 typedef struct PnvXScomInterface {
     Object parent;
 } PnvXScomInterface;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] ppc/pnv: fix compile breakage on old gcc
  2016-11-07 18:03 [Qemu-devel] [PATCH] ppc/pnv: fix compile breakage on old gcc Cédric Le Goater
@ 2016-11-07 23:36 ` David Gibson
  0 siblings, 0 replies; 2+ messages in thread
From: David Gibson @ 2016-11-07 23:36 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: qemu-ppc, qemu-devel, Olaf Hering

[-- Attachment #1: Type: text/plain, Size: 2950 bytes --]

On Mon, Nov 07, 2016 at 07:03:02PM +0100, Cédric Le Goater wrote:
> PnvChip is defined twice and this can confuse old compilers :
> 
>   CC      ppc64-softmmu/hw/ppc/pnv_xscom.o
> In file included from qemu.git/hw/ppc/pnv.c:29:
> qemu.git/include/hw/ppc/pnv.h:60: error: redefinition of typedef ‘PnvChip’
> qemu.git/include/hw/ppc/pnv_xscom.h:24: note: previous declaration of ‘PnvChip’ was here
> make[1]: *** [hw/ppc/pnv.o] Error 1
> make[1]: *** Waiting for unfinished jobs....
> 
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Applied to ppc-for-2.8, thanks.

> ---
> 
>  Tested with gcc version 4.4.7 20120313
> 
>  hw/ppc/pnv_core.c          | 1 +
>  hw/ppc/pnv_lpc.c           | 3 ++-
>  hw/ppc/pnv_xscom.c         | 2 +-
>  include/hw/ppc/pnv.h       | 1 -
>  include/hw/ppc/pnv_xscom.h | 2 --
>  5 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/ppc/pnv_core.c b/hw/ppc/pnv_core.c
> index 2acda9637db5..76ce854b0c40 100644
> --- a/hw/ppc/pnv_core.c
> +++ b/hw/ppc/pnv_core.c
> @@ -24,6 +24,7 @@
>  #include "hw/ppc/ppc.h"
>  #include "hw/ppc/pnv.h"
>  #include "hw/ppc/pnv_core.h"
> +#include "hw/ppc/pnv_xscom.h"
>  
>  static void powernv_cpu_reset(void *opaque)
>  {
> diff --git a/hw/ppc/pnv_lpc.c b/hw/ppc/pnv_lpc.c
> index 00dbd8b07b38..0e2117f0f5bc 100644
> --- a/hw/ppc/pnv_lpc.c
> +++ b/hw/ppc/pnv_lpc.c
> @@ -23,8 +23,9 @@
>  #include "qapi/error.h"
>  #include "qemu/log.h"
>  
> -#include "hw/ppc/pnv_lpc.h"
>  #include "hw/ppc/pnv.h"
> +#include "hw/ppc/pnv_lpc.h"
> +#include "hw/ppc/pnv_xscom.h"
>  #include "hw/ppc/fdt.h"
>  
>  #include <libfdt.h>
> diff --git a/hw/ppc/pnv_xscom.c b/hw/ppc/pnv_xscom.c
> index 5aaa264bd75c..f46646141a96 100644
> --- a/hw/ppc/pnv_xscom.c
> +++ b/hw/ppc/pnv_xscom.c
> @@ -25,8 +25,8 @@
>  #include "hw/sysbus.h"
>  
>  #include "hw/ppc/fdt.h"
> -#include "hw/ppc/pnv_xscom.h"
>  #include "hw/ppc/pnv.h"
> +#include "hw/ppc/pnv_xscom.h"
>  
>  #include <libfdt.h>
>  
> diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h
> index 02ac1c5f428e..7bee658733db 100644
> --- a/include/hw/ppc/pnv.h
> +++ b/include/hw/ppc/pnv.h
> @@ -21,7 +21,6 @@
>  
>  #include "hw/boards.h"
>  #include "hw/sysbus.h"
> -#include "hw/ppc/pnv_xscom.h"
>  #include "hw/ppc/pnv_lpc.h"
>  
>  #define TYPE_PNV_CHIP "powernv-chip"
> diff --git a/include/hw/ppc/pnv_xscom.h b/include/hw/ppc/pnv_xscom.h
> index c0a2fbb9f6f8..41a5127a1907 100644
> --- a/include/hw/ppc/pnv_xscom.h
> +++ b/include/hw/ppc/pnv_xscom.h
> @@ -21,8 +21,6 @@
>  
>  #include "qom/object.h"
>  
> -typedef struct PnvChip PnvChip;
> -
>  typedef struct PnvXScomInterface {
>      Object parent;
>  } PnvXScomInterface;

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-08  1:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-07 18:03 [Qemu-devel] [PATCH] ppc/pnv: fix compile breakage on old gcc Cédric Le Goater
2016-11-07 23:36 ` David Gibson

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).