--- researchv9/cmd/sun/mip/pftn.c 2018/04/24 17:21:59 1.1 +++ researchv9/cmd/sun/mip/pftn.c 2018/04/24 17:25:12 1.1.1.2 @@ -430,6 +430,9 @@ dclargs(){ # ifndef BUG1 if( ddebug > 2) printf("dclargs()\n"); # endif +#ifndef LINT + pfstab( STP(curftn)->sname ); +#endif for( i=0; i=0 ) defid( q, MOE ); } -bstruct( idn, soru ){ /* begining of structure or union declaration */ - register NODE *q; - +extern char *hash(), *index(), *rindex(); +static int fakeprev, fakenum; +static char fakestub[32], fakename[64]; + +bstruct( idn, soru ) +register idn,soru; +{ + /* begining of structure or union declaration */ + register NODE *q; + + if (idn < 0) { + char *p; + if ((p = rindex(ftitle, '/')) == NULL) + p = ftitle; + strcpy(fakestub, ++p); + if (p = index(fakestub, '"')) + *p = '\0'; + sprintf(fakename, "%s$%d.%d", fakestub, lineno, ++fakenum); + idn = lookup(hash(fakename), STAG); + } psave( instruct ); psave( curclass ); psave( strucoff ); @@ -509,17 +529,17 @@ bstruct( idn, soru ){ /* begining of str if( instruct==INSTRUCT ){ curclass = MOS; q->in.type = STRTY; - if( idn >= 0 ) defid( q, STNAME ); + defid( q, STNAME ); } else if( instruct == INUNION ) { curclass = MOU; q->in.type = UNIONTY; - if( idn >= 0 ) defid( q, UNAME ); + defid( q, UNAME ); } else { /* enum */ curclass = MOE; q->in.type = ENUMTY; - if( idn >= 0 ) defid( q, ENAME ); + defid( q, ENAME ); } psave( idn = q->tn.rval ); /* the "real" definition is where the members are seen */