* [Qemu-devel] [PATCH] typedefs: add QJSON
@ 2018-06-08 8:39 Greg Kurz
2018-06-08 9:04 ` Dr. David Alan Gilbert
2018-06-15 11:19 ` Dr. David Alan Gilbert
0 siblings, 2 replies; 5+ messages in thread
From: Greg Kurz @ 2018-06-08 8:39 UTC (permalink / raw)
To: qemu-devel; +Cc: Juan Quintela, Dr. David Alan Gilbert
Since commit 83ee768d6247b, we now have two places that define the
QJSON type:
$ git grep 'typedef struct QJSON QJSON'
include/migration/vmstate.h:typedef struct QJSON QJSON;
migration/qjson.h:typedef struct QJSON QJSON;
This breaks docker-test-build@centos6:
In file included from /tmp/qemu-test/src/migration/savevm.c:59:
/tmp/qemu-test/src/migration/qjson.h:16: error: redefinition of typedef
'QJSON'
/tmp/qemu-test/src/include/migration/vmstate.h:30: note: previous
declaration of 'QJSON' was here
make: *** [migration/savevm.o] Error 1
This happens because CentOS 6 has an old GCC 4.4.7. Even if redefining
a typedef with the same type is permitted since GCC 4.6, unless -pedantic
is passed, we don't really need to do that on purpose. Let's have a
single definition in <qemu/typedefs.h> instead.
Signed-off-by: Greg Kurz <groug@kaod.org>
---
include/migration/vmstate.h | 2 --
include/qemu/typedefs.h | 1 +
migration/qjson.h | 2 --
3 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index 3747110f951a..42b946ce902c 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -27,8 +27,6 @@
#ifndef QEMU_VMSTATE_H
#define QEMU_VMSTATE_H
-typedef struct QJSON QJSON;
-
typedef struct VMStateInfo VMStateInfo;
typedef struct VMStateDescription VMStateDescription;
typedef struct VMStateField VMStateField;
diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
index 325c72de3313..3ec0e13a967f 100644
--- a/include/qemu/typedefs.h
+++ b/include/qemu/typedefs.h
@@ -97,6 +97,7 @@ typedef struct QEMUTimer QEMUTimer;
typedef struct QEMUTimerListGroup QEMUTimerListGroup;
typedef struct QBool QBool;
typedef struct QDict QDict;
+typedef struct QJSON QJSON;
typedef struct QList QList;
typedef struct QNull QNull;
typedef struct QNum QNum;
diff --git a/migration/qjson.h b/migration/qjson.h
index 2978b5f37121..41664f2d71b5 100644
--- a/migration/qjson.h
+++ b/migration/qjson.h
@@ -13,8 +13,6 @@
#ifndef QEMU_QJSON_H
#define QEMU_QJSON_H
-typedef struct QJSON QJSON;
-
QJSON *qjson_new(void);
void qjson_destroy(QJSON *json);
void json_prop_str(QJSON *json, const char *name, const char *str);
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] typedefs: add QJSON
2018-06-08 8:39 [Qemu-devel] [PATCH] typedefs: add QJSON Greg Kurz
@ 2018-06-08 9:04 ` Dr. David Alan Gilbert
2018-06-08 9:19 ` Greg Kurz
2018-06-15 11:19 ` Dr. David Alan Gilbert
1 sibling, 1 reply; 5+ messages in thread
From: Dr. David Alan Gilbert @ 2018-06-08 9:04 UTC (permalink / raw)
To: Greg Kurz; +Cc: qemu-devel, Juan Quintela
* Greg Kurz (groug@kaod.org) wrote:
> Since commit 83ee768d6247b, we now have two places that define the
> QJSON type:
>
> $ git grep 'typedef struct QJSON QJSON'
> include/migration/vmstate.h:typedef struct QJSON QJSON;
> migration/qjson.h:typedef struct QJSON QJSON;
>
> This breaks docker-test-build@centos6:
>
> In file included from /tmp/qemu-test/src/migration/savevm.c:59:
> /tmp/qemu-test/src/migration/qjson.h:16: error: redefinition of typedef
> 'QJSON'
> /tmp/qemu-test/src/include/migration/vmstate.h:30: note: previous
> declaration of 'QJSON' was here
> make: *** [migration/savevm.o] Error 1
>
> This happens because CentOS 6 has an old GCC 4.4.7. Even if redefining
> a typedef with the same type is permitted since GCC 4.6, unless -pedantic
> is passed, we don't really need to do that on purpose. Let's have a
> single definition in <qemu/typedefs.h> instead.
>
> Signed-off-by: Greg Kurz <groug@kaod.org>
Yeh that looks right to me;
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
> include/migration/vmstate.h | 2 --
> include/qemu/typedefs.h | 1 +
> migration/qjson.h | 2 --
> 3 files changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
> index 3747110f951a..42b946ce902c 100644
> --- a/include/migration/vmstate.h
> +++ b/include/migration/vmstate.h
> @@ -27,8 +27,6 @@
> #ifndef QEMU_VMSTATE_H
> #define QEMU_VMSTATE_H
>
> -typedef struct QJSON QJSON;
> -
> typedef struct VMStateInfo VMStateInfo;
> typedef struct VMStateDescription VMStateDescription;
> typedef struct VMStateField VMStateField;
> diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
> index 325c72de3313..3ec0e13a967f 100644
> --- a/include/qemu/typedefs.h
> +++ b/include/qemu/typedefs.h
> @@ -97,6 +97,7 @@ typedef struct QEMUTimer QEMUTimer;
> typedef struct QEMUTimerListGroup QEMUTimerListGroup;
> typedef struct QBool QBool;
> typedef struct QDict QDict;
> +typedef struct QJSON QJSON;
> typedef struct QList QList;
> typedef struct QNull QNull;
> typedef struct QNum QNum;
> diff --git a/migration/qjson.h b/migration/qjson.h
> index 2978b5f37121..41664f2d71b5 100644
> --- a/migration/qjson.h
> +++ b/migration/qjson.h
> @@ -13,8 +13,6 @@
> #ifndef QEMU_QJSON_H
> #define QEMU_QJSON_H
>
> -typedef struct QJSON QJSON;
> -
> QJSON *qjson_new(void);
> void qjson_destroy(QJSON *json);
> void json_prop_str(QJSON *json, const char *name, const char *str);
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] typedefs: add QJSON
2018-06-08 9:04 ` Dr. David Alan Gilbert
@ 2018-06-08 9:19 ` Greg Kurz
2018-06-08 9:20 ` Dr. David Alan Gilbert
0 siblings, 1 reply; 5+ messages in thread
From: Greg Kurz @ 2018-06-08 9:19 UTC (permalink / raw)
To: Dr. David Alan Gilbert; +Cc: qemu-devel, Juan Quintela
On Fri, 8 Jun 2018 10:04:39 +0100
"Dr. David Alan Gilbert" <dgilbert@redhat.com> wrote:
> * Greg Kurz (groug@kaod.org) wrote:
> > Since commit 83ee768d6247b, we now have two places that define the
> > QJSON type:
> >
> > $ git grep 'typedef struct QJSON QJSON'
> > include/migration/vmstate.h:typedef struct QJSON QJSON;
> > migration/qjson.h:typedef struct QJSON QJSON;
> >
> > This breaks docker-test-build@centos6:
> >
> > In file included from /tmp/qemu-test/src/migration/savevm.c:59:
> > /tmp/qemu-test/src/migration/qjson.h:16: error: redefinition of typedef
> > 'QJSON'
> > /tmp/qemu-test/src/include/migration/vmstate.h:30: note: previous
> > declaration of 'QJSON' was here
> > make: *** [migration/savevm.o] Error 1
> >
> > This happens because CentOS 6 has an old GCC 4.4.7. Even if redefining
> > a typedef with the same type is permitted since GCC 4.6, unless -pedantic
> > is passed, we don't really need to do that on purpose. Let's have a
> > single definition in <qemu/typedefs.h> instead.
> >
> > Signed-off-by: Greg Kurz <groug@kaod.org>
>
> Yeh that looks right to me;
>
>
> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
>
Hi Dave,
Whose tree should this go through ?
$ git show | ./scripts/get_maintainer.pl
Juan Quintela <quintela@redhat.com> (maintainer:Migration)
"Dr. David Alan Gilbert" <dgilbert@redhat.com> (maintainer:Migration)
qemu-devel@nongnu.org (open list:All patches CC here)
Cheers,
--
Greg
> > ---
> > include/migration/vmstate.h | 2 --
> > include/qemu/typedefs.h | 1 +
> > migration/qjson.h | 2 --
> > 3 files changed, 1 insertion(+), 4 deletions(-)
> >
> > diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
> > index 3747110f951a..42b946ce902c 100644
> > --- a/include/migration/vmstate.h
> > +++ b/include/migration/vmstate.h
> > @@ -27,8 +27,6 @@
> > #ifndef QEMU_VMSTATE_H
> > #define QEMU_VMSTATE_H
> >
> > -typedef struct QJSON QJSON;
> > -
> > typedef struct VMStateInfo VMStateInfo;
> > typedef struct VMStateDescription VMStateDescription;
> > typedef struct VMStateField VMStateField;
> > diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
> > index 325c72de3313..3ec0e13a967f 100644
> > --- a/include/qemu/typedefs.h
> > +++ b/include/qemu/typedefs.h
> > @@ -97,6 +97,7 @@ typedef struct QEMUTimer QEMUTimer;
> > typedef struct QEMUTimerListGroup QEMUTimerListGroup;
> > typedef struct QBool QBool;
> > typedef struct QDict QDict;
> > +typedef struct QJSON QJSON;
> > typedef struct QList QList;
> > typedef struct QNull QNull;
> > typedef struct QNum QNum;
> > diff --git a/migration/qjson.h b/migration/qjson.h
> > index 2978b5f37121..41664f2d71b5 100644
> > --- a/migration/qjson.h
> > +++ b/migration/qjson.h
> > @@ -13,8 +13,6 @@
> > #ifndef QEMU_QJSON_H
> > #define QEMU_QJSON_H
> >
> > -typedef struct QJSON QJSON;
> > -
> > QJSON *qjson_new(void);
> > void qjson_destroy(QJSON *json);
> > void json_prop_str(QJSON *json, const char *name, const char *str);
> >
> --
> Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] typedefs: add QJSON
2018-06-08 9:19 ` Greg Kurz
@ 2018-06-08 9:20 ` Dr. David Alan Gilbert
0 siblings, 0 replies; 5+ messages in thread
From: Dr. David Alan Gilbert @ 2018-06-08 9:20 UTC (permalink / raw)
To: Greg Kurz; +Cc: qemu-devel, Juan Quintela
* Greg Kurz (groug@kaod.org) wrote:
> On Fri, 8 Jun 2018 10:04:39 +0100
> "Dr. David Alan Gilbert" <dgilbert@redhat.com> wrote:
>
> > * Greg Kurz (groug@kaod.org) wrote:
> > > Since commit 83ee768d6247b, we now have two places that define the
> > > QJSON type:
> > >
> > > $ git grep 'typedef struct QJSON QJSON'
> > > include/migration/vmstate.h:typedef struct QJSON QJSON;
> > > migration/qjson.h:typedef struct QJSON QJSON;
> > >
> > > This breaks docker-test-build@centos6:
> > >
> > > In file included from /tmp/qemu-test/src/migration/savevm.c:59:
> > > /tmp/qemu-test/src/migration/qjson.h:16: error: redefinition of typedef
> > > 'QJSON'
> > > /tmp/qemu-test/src/include/migration/vmstate.h:30: note: previous
> > > declaration of 'QJSON' was here
> > > make: *** [migration/savevm.o] Error 1
> > >
> > > This happens because CentOS 6 has an old GCC 4.4.7. Even if redefining
> > > a typedef with the same type is permitted since GCC 4.6, unless -pedantic
> > > is passed, we don't really need to do that on purpose. Let's have a
> > > single definition in <qemu/typedefs.h> instead.
> > >
> > > Signed-off-by: Greg Kurz <groug@kaod.org>
> >
> > Yeh that looks right to me;
> >
> >
> > Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> >
>
> Hi Dave,
>
> Whose tree should this go through ?
I'm happy to take it through migration.
Dave
> $ git show | ./scripts/get_maintainer.pl
> Juan Quintela <quintela@redhat.com> (maintainer:Migration)
> "Dr. David Alan Gilbert" <dgilbert@redhat.com> (maintainer:Migration)
> qemu-devel@nongnu.org (open list:All patches CC here)
>
> Cheers,
>
> --
> Greg
>
> > > ---
> > > include/migration/vmstate.h | 2 --
> > > include/qemu/typedefs.h | 1 +
> > > migration/qjson.h | 2 --
> > > 3 files changed, 1 insertion(+), 4 deletions(-)
> > >
> > > diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
> > > index 3747110f951a..42b946ce902c 100644
> > > --- a/include/migration/vmstate.h
> > > +++ b/include/migration/vmstate.h
> > > @@ -27,8 +27,6 @@
> > > #ifndef QEMU_VMSTATE_H
> > > #define QEMU_VMSTATE_H
> > >
> > > -typedef struct QJSON QJSON;
> > > -
> > > typedef struct VMStateInfo VMStateInfo;
> > > typedef struct VMStateDescription VMStateDescription;
> > > typedef struct VMStateField VMStateField;
> > > diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
> > > index 325c72de3313..3ec0e13a967f 100644
> > > --- a/include/qemu/typedefs.h
> > > +++ b/include/qemu/typedefs.h
> > > @@ -97,6 +97,7 @@ typedef struct QEMUTimer QEMUTimer;
> > > typedef struct QEMUTimerListGroup QEMUTimerListGroup;
> > > typedef struct QBool QBool;
> > > typedef struct QDict QDict;
> > > +typedef struct QJSON QJSON;
> > > typedef struct QList QList;
> > > typedef struct QNull QNull;
> > > typedef struct QNum QNum;
> > > diff --git a/migration/qjson.h b/migration/qjson.h
> > > index 2978b5f37121..41664f2d71b5 100644
> > > --- a/migration/qjson.h
> > > +++ b/migration/qjson.h
> > > @@ -13,8 +13,6 @@
> > > #ifndef QEMU_QJSON_H
> > > #define QEMU_QJSON_H
> > >
> > > -typedef struct QJSON QJSON;
> > > -
> > > QJSON *qjson_new(void);
> > > void qjson_destroy(QJSON *json);
> > > void json_prop_str(QJSON *json, const char *name, const char *str);
> > >
> > --
> > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] typedefs: add QJSON
2018-06-08 8:39 [Qemu-devel] [PATCH] typedefs: add QJSON Greg Kurz
2018-06-08 9:04 ` Dr. David Alan Gilbert
@ 2018-06-15 11:19 ` Dr. David Alan Gilbert
1 sibling, 0 replies; 5+ messages in thread
From: Dr. David Alan Gilbert @ 2018-06-15 11:19 UTC (permalink / raw)
To: Greg Kurz; +Cc: qemu-devel, Juan Quintela
* Greg Kurz (groug@kaod.org) wrote:
> Since commit 83ee768d6247b, we now have two places that define the
> QJSON type:
>
> $ git grep 'typedef struct QJSON QJSON'
> include/migration/vmstate.h:typedef struct QJSON QJSON;
> migration/qjson.h:typedef struct QJSON QJSON;
>
> This breaks docker-test-build@centos6:
>
> In file included from /tmp/qemu-test/src/migration/savevm.c:59:
> /tmp/qemu-test/src/migration/qjson.h:16: error: redefinition of typedef
> 'QJSON'
> /tmp/qemu-test/src/include/migration/vmstate.h:30: note: previous
> declaration of 'QJSON' was here
> make: *** [migration/savevm.o] Error 1
>
> This happens because CentOS 6 has an old GCC 4.4.7. Even if redefining
> a typedef with the same type is permitted since GCC 4.6, unless -pedantic
> is passed, we don't really need to do that on purpose. Let's have a
> single definition in <qemu/typedefs.h> instead.
>
> Signed-off-by: Greg Kurz <groug@kaod.org>
Queued.
Dave
> ---
> include/migration/vmstate.h | 2 --
> include/qemu/typedefs.h | 1 +
> migration/qjson.h | 2 --
> 3 files changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
> index 3747110f951a..42b946ce902c 100644
> --- a/include/migration/vmstate.h
> +++ b/include/migration/vmstate.h
> @@ -27,8 +27,6 @@
> #ifndef QEMU_VMSTATE_H
> #define QEMU_VMSTATE_H
>
> -typedef struct QJSON QJSON;
> -
> typedef struct VMStateInfo VMStateInfo;
> typedef struct VMStateDescription VMStateDescription;
> typedef struct VMStateField VMStateField;
> diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
> index 325c72de3313..3ec0e13a967f 100644
> --- a/include/qemu/typedefs.h
> +++ b/include/qemu/typedefs.h
> @@ -97,6 +97,7 @@ typedef struct QEMUTimer QEMUTimer;
> typedef struct QEMUTimerListGroup QEMUTimerListGroup;
> typedef struct QBool QBool;
> typedef struct QDict QDict;
> +typedef struct QJSON QJSON;
> typedef struct QList QList;
> typedef struct QNull QNull;
> typedef struct QNum QNum;
> diff --git a/migration/qjson.h b/migration/qjson.h
> index 2978b5f37121..41664f2d71b5 100644
> --- a/migration/qjson.h
> +++ b/migration/qjson.h
> @@ -13,8 +13,6 @@
> #ifndef QEMU_QJSON_H
> #define QEMU_QJSON_H
>
> -typedef struct QJSON QJSON;
> -
> QJSON *qjson_new(void);
> void qjson_destroy(QJSON *json);
> void json_prop_str(QJSON *json, const char *name, const char *str);
>
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-06-15 11:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-08 8:39 [Qemu-devel] [PATCH] typedefs: add QJSON Greg Kurz
2018-06-08 9:04 ` Dr. David Alan Gilbert
2018-06-08 9:19 ` Greg Kurz
2018-06-08 9:20 ` Dr. David Alan Gilbert
2018-06-15 11:19 ` Dr. David Alan Gilbert
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).