public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/51741] New: complicatet brakets wont compile
@ 2012-01-03 15:07 digsag at web dot de
  2012-01-03 15:19 ` [Bug c/51741] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: digsag at web dot de @ 2012-01-03 15:07 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-01-03 15:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-03 15:07 [Bug c/51741] New: complicatet brakets wont compile digsag at web dot de
2012-01-03 15:19 ` [Bug c/51741] " rguenth at gcc dot gnu.org
2012-01-03 15:21 ` digsag at web dot de
2012-01-03 15:23 ` digsag at web dot de
2012-01-03 15:25 ` redi at gcc dot gnu.org
2012-01-03 15:47 ` digsag at web dot de
2012-01-03 15:53 ` redi at gcc dot gnu.org

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 read-only IMAP folder(s) and NNTP newsgroup(s).