This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/51741] New: complicatet brakets wont compile
- From: "digsag at web dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 03 Jan 2012 15:07:34 +0000
- Subject: [Bug c/51741] New: complicatet brakets wont compile
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: digsag@web.de
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