Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.216
 
1.217
 
MAIN:ragge:20080728161605
 
pftn.c
_>101101         int     rstr;
 102102         struct  symtab *rsym;
 103103         struct  symtab *rb;
<> 104+        int     flags;
  105+#define LASTELM 1
104106 } *rpole;
 105107 
 106108 /*
     
 !
747749         } else
 748750                 sp = NULL;
 749751 
<>750 -        r = tmpalloc(sizeof(struct rstack));
  752+        r = tmpcalloc(sizeof(struct rstack));
751753         r->rsou = soru;
<>752 -        r->rstr = 0;
753754         r->rsym = sp;
 754755         r->rb = NULL;
 755756         r->rnext = rpole;
     
 !
851852 soumemb(NODE *n, char *name, int class)
 852853 {
 853854         struct symtab *sp, *lsp;
<> 855+        int sz;
854856  
 855857         if (rpole == NULL)
 856858                 cerror("soumemb");
     
 !
867869                 lsp->snext = sp;
 868870         n->n_sp = sp;
 869871         defid(n, class);
<>870 -}
 871 - 
872872 
<> 873+        /*
  874+         * 6.7.2.1 clause 16:
  875+         * "...the last member of a structure with more than one
  876+         *  named member may have incomplete array type;"
  877+         */
  878+        sz = tsize(sp->stype, sp->sdf, sp->ssue);
  879+        if ((rpole->flags & LASTELM) || (rpole->rb == sp && sz == 0))
  880+                uerror("incomplete array in struct");
  881+        if (sz == 0)
  882+                rpole->flags |= LASTELM;
873883 
<> 884+        /*
  885+         * 6.7.2.1 clause 2:
  886+         * "...such a structure shall not be a member of a structure
  887+         *  or an element of an array."
  888+         */
  889+        if (sp->stype == STRTY && sp->ssue->sylnk) {
  890+                struct symtab *lnk;
  891+
  892+                for (lnk = sp->ssue->sylnk; lnk->snext; lnk = lnk->snext)
  893+                        ;
  894+                if (tsize(lnk->stype, lnk->sdf, lnk->ssue) == 0)
  895+                        uerror("incomplete struct in struct");
  896+        }
  897+}
  898+
<_874899 /*
 875900  * error printing routine in parser
 876901  */
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-09-22 10:14 +0200