From: Greg Kurz <groug@kaod.org>
To: Thomas Huth <thuth@redhat.com>
Cc: "Cédric Le Goater" <clg@kaod.org>,
qemu-devel@nongnu.org, qemu-ppc@nongnu.org, pbonzini@redhat.com,
"Daniel P. Berrangé" <berrange@redhat.com>,
"David Gibson" <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH v5 2/3] ppc: Fix duplicated typedefs to be able to compile with Clang in gnu99 mode
Date: Thu, 17 Jan 2019 08:58:54 +0100 [thread overview]
Message-ID: <20190117085854.76229ec2@bahia.lan> (raw)
In-Reply-To: <0a108f6c-8c9b-1b1e-463d-c3af171c2f19@redhat.com>
On Thu, 17 Jan 2019 08:01:25 +0100
Thomas Huth <thuth@redhat.com> wrote:
> On 2019-01-16 14:29, Cédric Le Goater wrote:
> > On 1/16/19 12:47 PM, Thomas Huth wrote:
> >> On 2019-01-16 12:43, Cédric Le Goater wrote:
> >>> On 1/11/19 9:17 AM, Thomas Huth wrote:
> >>>> When compiling the ppc code with clang and -std=gnu99, there are a
> >>>> couple of warnings/errors like this one:
> >>>>
> >>>> CC ppc64-softmmu/hw/intc/xics.o
> >>>> In file included from hw/intc/xics.c:35:
> >>>> include/hw/ppc/xics.h:43:25: error: redefinition of typedef 'ICPState' is a C11 feature
> >>>> [-Werror,-Wtypedef-redefinition]
> >>>> typedef struct ICPState ICPState;
> >>>> ^
> >>>> target/ppc/cpu.h:1181:25: note: previous definition is here
> >>>> typedef struct ICPState ICPState;
> >>>> ^
> >>>> Work around the problems by including the proper headers instead.
> >>>
> >>> Thomas,
> >>>
> >>>
> >>> After a closer look, I think we should use 'void *' under PowerPCCPU
> >>> as it was the case before I introduced the second interrupt presenter.
> >>
> >> If you don't like the #includes, why not simply do anonymous struct
> >> forward declarations here? I think that would be better than "void *".
> >
> > yes.
> >
> >>> That's a bigger change reverting bits of already merged patches. I can
> >>> take care of it if you prefer.
> >>
> >> Could I keep the current patch in my series so that I can get the
> >> patches finally merged? You could then do any clean up that you like on
> >> top of it, ok?
> >
> > OK.
> >
> > See below the patch I would propose. Compiled tested with clang -std=gnu99.
> [...]
> > @@ -1204,8 +1199,8 @@ struct PowerPCCPU {
> > int32_t node_id; /* NUMA node this CPU belongs to */
> > PPCHash64Options *hash64_opts;
> > #ifndef CONFIG_USER_ONLY
> > - ICPState *icp;
> > - XiveTCTX *tctx;
> > + struct ICPState *icp;
> > + struct XiveTCTX *tctx;
> > #endif
>
> That's pretty much what I had in an earlier version of my patch:
>
> https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg01810.html
>
> But Greg did not like it:
>
> https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg01893.html
>
Yeah I didn't but the #includes bring even more troubles so I won't object
if we go for struct :) For the long term, I still think that icp and tctx
should be hidden behind void *machine_data in a per-machine struct.
> Thomas
next prev parent reply other threads:[~2019-01-17 7:59 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-11 8:17 [Qemu-devel] [PATCH v5 0/3] Force the C standard to gnu99 Thomas Huth
2019-01-11 8:17 ` [Qemu-devel] [PATCH v5 1/3] ppc: Move spapr-related prototypes from xics.h into a seperate header file Thomas Huth
2019-01-11 9:22 ` Daniel P. Berrangé
2019-01-11 12:58 ` Philippe Mathieu-Daudé
2019-01-11 8:17 ` [Qemu-devel] [PATCH v5 2/3] ppc: Fix duplicated typedefs to be able to compile with Clang in gnu99 mode Thomas Huth
2019-01-11 8:30 ` Cédric Le Goater
2019-01-11 8:40 ` Greg Kurz
2019-01-11 9:22 ` Daniel P. Berrangé
2019-01-11 12:59 ` Philippe Mathieu-Daudé
2019-01-16 11:43 ` Cédric Le Goater
2019-01-16 11:47 ` Thomas Huth
2019-01-16 13:23 ` Greg Kurz
2019-01-16 13:44 ` Thomas Huth
2019-01-16 15:11 ` Greg Kurz
2019-01-16 17:26 ` Cédric Le Goater
2019-01-16 13:29 ` Cédric Le Goater
2019-01-17 7:01 ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
2019-01-17 7:58 ` Greg Kurz [this message]
2019-01-17 8:02 ` Cédric Le Goater
2019-01-11 8:17 ` [Qemu-devel] [PATCH v5 3/3] configure: Force the C standard to gnu99 Thomas Huth
2019-01-11 8:44 ` Greg Kurz
2019-01-11 9:23 ` Daniel P. Berrangé
2019-01-11 10:55 ` Alex Bennée
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=20190117085854.76229ec2@bahia.lan \
--to=groug@kaod.org \
--cc=berrange@redhat.com \
--cc=clg@kaod.org \
--cc=david@gibson.dropbear.id.au \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=thuth@redhat.com \
/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).