http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51741
Bug #: 51741
Summary: complicatet brakets wont compile
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c
AssignedTo: [email protected]
ReportedBy: [email protected]
flowing structure:
typedef struct{//branch
char what;
void *where; //cast to knot *
}branch;
typedef struct{//knot
void *father; //cast to knot *
branch *branches;
}knot;
adressing a knot** to hand it to a subfun wont compile:
// (*pos)
// ( .branches)
// ( [i])
// ( .where)
// ((knot*) )
// (& )
(&((knot*)((((*pos).branches)[i]).where)))
(compiler sas lvaluve needed for unary & operator)
but
// (*pos)
// ( .branches)
// ( [i])
// ( .where)
// (& )
// ((knot**) )
((knot**)(&((((*pos).branches)[i]).where)))
((knot**)(&((((*pos).branches)[i]).where)))
will.
both seem like legal C to me.
another one:
// (*pos)
// ( .branches)
// ( [0])
// ( .where)
// ((knot*) )
// ( .father)
(((knot*)((((*pos).branches)[0]).where)).father)=pos;
won't compile .
compiler thinks I try to adress .father for something thats not a structure or
a union. even though I castet it to a knot* before trying to adress .father.
yours
stfu&thnk