check array depends for modifications for W214
This commit is contained in:
parent
116ec5f0fd
commit
ffb161ad95
@ -4907,10 +4907,21 @@ static int testsymbols(symbol *root,int level,int testlabs,int testconst)
|
|||||||
error(204,sym->name); /* value assigned to symbol is never used */
|
error(204,sym->name); /* value assigned to symbol is never used */
|
||||||
errorset(sSETPOS,-1);
|
errorset(sSETPOS,-1);
|
||||||
} else if ((sym->usage & (uWRITTEN | uPUBLIC | uCONST))==0 && sym->ident==iREFARRAY) {
|
} else if ((sym->usage & (uWRITTEN | uPUBLIC | uCONST))==0 && sym->ident==iREFARRAY) {
|
||||||
|
int warn = 1;
|
||||||
|
symbol* depend = finddepend(sym);
|
||||||
|
while (depend != NULL) {
|
||||||
|
if ((depend->usage & (uWRITTEN | uPUBLIC | uCONST)) != 0) {
|
||||||
|
warn = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
depend = finddepend(depend);
|
||||||
|
} /* while */
|
||||||
|
if (warn) {
|
||||||
errorset(sSETPOS, sym->lnumber);
|
errorset(sSETPOS, sym->lnumber);
|
||||||
error(214, sym->name); /* make array argument "const" */
|
error(214, sym->name); /* make array argument "const" */
|
||||||
errorset(sSETPOS, -1);
|
errorset(sSETPOS, -1);
|
||||||
} /* if */
|
} /* if */
|
||||||
|
} /* if */
|
||||||
/* also mark the variable (local or global) to the debug information */
|
/* also mark the variable (local or global) to the debug information */
|
||||||
if ((sym->usage & (uWRITTEN | uREAD))!=0 && (sym->usage & uNATIVE)==0)
|
if ((sym->usage & (uWRITTEN | uREAD))!=0 && (sym->usage & uNATIVE)==0)
|
||||||
insert_dbgsymbol(sym);
|
insert_dbgsymbol(sym);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user