}
if(n->op != ONAME || n->class != PAUTO)
continue;
- lineno = n->lineno;
- typecheck(&n, Erv | Easgn); // only needed for unused variables
if(n->type == T)
continue;
- // if(!n->used && n->sym->name[0] != '&')
- // yyerror("%S declared and not used", n->sym);
dowidth(n->type);
w = n->type->width;
if(w >= 100000000)
switch(nr->op) {
case ONAME:
+ gused(nr);
break;
// unary
n->typecheck = 1;
for(ll=n->list; ll; ll=ll->next)
if(ll->n->typecheck == 0)
- typecheck(&ll->n, Erv);
+ typecheck(&ll->n, Erv | Easgn);
}
void
n->typecheck = 1;
for(ll=n->list; ll; ll=ll->next)
if(ll->n->typecheck == 0)
- typecheck(&ll->n, Erv);
+ typecheck(&ll->n, Erv | Easgn);
}
/*
walk(Node *fn)
{
char s[50];
+ NodeList *l;
+ Node *n;
+ int lno;
curfn = fn;
if(debug['W']) {
if(walkret(curfn->nbody))
yyerror("function ends without a return statement");
typechecklist(curfn->nbody, Etop);
+ lno = lineno;
+ for(l=fn->dcl; l; l=l->next) {
+ n = l->n;
+ if(n->op != ONAME || n->class != PAUTO)
+ continue;
+ lineno = n->lineno;
+ typecheck(&n, Erv | Easgn); // only needed for unused variables
+ if(!n->used && n->sym->name[0] != '&')
+ yyerror("%S declared and not used", n->sym);
+ }
+ lineno = lno;
if(nerrors != 0)
return;
walkstmtlist(curfn->nbody);