This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] make it safe to include basic-block.h and tree-flow.h from C++
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: rafael dot espindola at gmail dot com (Rafael Ãvila de EspÃndola)
- Cc: pinskia at physics dot uc dot edu (Andrew Pinski), gcc-patches at gcc dot gnu dot org
- Date: Fri, 9 Dec 2005 11:32:59 -0500 (EST)
- Subject: Re: [PATCH] make it safe to include basic-block.h and tree-flow.h from C++
>
> --nextPart2177227.cpKDWpm67v
> Content-Type: text/plain;
> charset="utf-8"
> Content-Transfer-Encoding: quoted-printable
> Content-Disposition: inline
>
> On Friday 09 December 2005 14:09, Andrew Pinski wrote:
> > Why is this needed as edge is a typedef to "struct edge_def *" which is
> > legal C++ do to the following:
> >
> > struct a;
> > typedef struct a *aptr;
> > aptr g;
> > struct a
> > {
> > int i;
> > };
> I am not sure why, but the error message was:
> =2E./../apple/gcc/tree-flow.h:341: error: declaration of =E2=80=98edge_def*=
> =20
> edge_prediction::edge=E2=80=99
> =2E./../apple/gcc/basic-block.h:146: error: changes meaning of =E2=80=98edg=
> e=E2=80=99 from=20
> =E2=80=98typedef struct edge_def* edge=E2=80=99
Actually your patch is incorrect and does not fix the real issue.
The problem is in the struct edge_prediction.
struct edge_prediction GTY((chain_next ("%h.next")))
{
struct edge_prediction *next;
edge edge;
enum br_predictor predictor;
int probability;
};
You should change the name edge to something different.
That will fix the issue without change all of edge in tree-flow.h.
-- Pinski