Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.231
 
1.232
 
MAIN:ragge:20081120211909
 
pftn.c
_>621621                 sp->stype = STRTY;
 622622         else if (class == UNAME)
 623623                 sp->stype = UNIONTY;
<> 624+        else if (class == ENAME)
  625+                sp->stype = ENUMTY;
624626 }
 625627 
 626628 /*
     
 !
693695                 return NULL;
 694696 
 695697         sp = deftag(name, ENAME);
<>696 -        if (sp->stype != UNDEF) {
  698+        if (sp->stype != ENUMTY) {
697699                 if (sp->slevel == blevel)
 698700                         uerror("%s redeclared", name);
 699701                 sp = hide(sp);
 700702                 defstr(sp, ENAME);
 701703         }
<> 704+        sp->ssue->sylnk = sp;   /* ourselves */
702705         return sp;
 703706 }
 704707 
     
 !
740743         NODE *p;
 741744 
 742745         sp = lookup(name, STAGNAME);
<> 746+
  747+#ifdef notdef
743748         /*
 744749          * 6.7.2.3 Clause 2:
 745750          * "A type specifier of the form 'enum identifier' without an
     
 !
748753          */
 749754         if (sp->sclass != ENAME)
 750755                 uerror("enum %s undeclared", name);
<> 756+#endif
  757+        if (sp->sclass == SNULL) {
  758+                /* declare existence of enum */
  759+                sp = enumhd(name);
  760+                sp->stype = ENUMTY;
  761+        }
751762 
 752763         p = mkty(sp->stype, 0, sp->ssue);
 753764         p->n_sp = sp;
     
 !
17561767         idp->n_type = ctype(idp->n_type);
 17571768 
 17581769         /* in case ctype has rewritten things */
<>1759 -        if ((t = BTYPE(idp->n_type)) != STRTY && t != UNIONTY)
  1770+        if ((t = BTYPE(idp->n_type)) != STRTY && t != UNIONTY && t != ENUMTY)
17601771                 idp->n_sue = MKSUE(t);
 17611772 
 17621773         if (idp->n_op != NAME) {
     
 !
21812192                 }
 21822193         }
 21832194 #endif
<> 2195+
  2196+        /* Check for undefined or late defined enums */
  2197+        if (BTYPE(f->n_type) == ENUMTY) {
  2198+                /* not-yet check if declared enum */
  2199+                if (f->n_sue->sylnk->stype != ENUMTY)
  2200+                        MODTYPE(f->n_type, f->n_sue->sylnk->stype);
  2201+                if (BTYPE(f->n_type) == ENUMTY)
  2202+                        uerror("enum %s not declared", f->n_sue->sylnk->sname);
  2203+        }
  2204+
<_21842205         /*
 21852206          * Do some basic checks.
 21862207          */
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-08-30 00:08 +0200