Reset errline to -1 instead of 0
This commit is contained in:
parent
0d9bb02970
commit
9a21fb5a2f
@ -2858,7 +2858,7 @@ static void decl_const(int vclass)
|
||||
/* temporarily reset the line number to where the symbol was defined */
|
||||
errorset(sSETPOS,symbolline);
|
||||
error(213); /* tagname mismatch */
|
||||
errorset(sSETPOS,0);
|
||||
errorset(sSETPOS,-1);
|
||||
} /* if */
|
||||
sym=add_constant(constname,val,vclass,tag);
|
||||
if (sym!=NULL)
|
||||
@ -4780,7 +4780,7 @@ static int testsymbols(symbol *root,int level,int testlabs,int testconst)
|
||||
} else if ((sym->usage & uREAD)==0) {
|
||||
errorset(sSETPOS,sym->lnumber);
|
||||
error(203,sym->name); /* symbol isn't used: ... */
|
||||
errorset(sSETPOS,0);
|
||||
errorset(sSETPOS,-1);
|
||||
} /* if */
|
||||
} /* if */
|
||||
break;
|
||||
@ -4800,7 +4800,7 @@ static int testsymbols(symbol *root,int level,int testlabs,int testconst)
|
||||
if (testconst && (sym->usage & uREAD)==0) {
|
||||
errorset(sSETPOS,sym->lnumber);
|
||||
error(203,sym->name); /* symbol isn't used: ... */
|
||||
errorset(sSETPOS,0);
|
||||
errorset(sSETPOS,-1);
|
||||
} /* if */
|
||||
break;
|
||||
default:
|
||||
@ -4810,16 +4810,16 @@ static int testsymbols(symbol *root,int level,int testlabs,int testconst)
|
||||
if ((sym->usage & (uWRITTEN | uREAD | uSTOCK | uPUBLIC))==0) {
|
||||
errorset(sSETPOS,sym->lnumber);
|
||||
error(203,sym->name,sym->lnumber); /* symbol isn't used (and not stock) */
|
||||
errorset(sSETPOS,0);
|
||||
errorset(sSETPOS,-1);
|
||||
} else if ((sym->usage & (uREAD | uSTOCK | uPUBLIC))==0) {
|
||||
errorset(sSETPOS,sym->lnumber);
|
||||
error(204,sym->name); /* value assigned to symbol is never used */
|
||||
errorset(sSETPOS,0);
|
||||
errorset(sSETPOS,-1);
|
||||
#if 0 // ??? not sure whether it is a good idea to force people use "const"
|
||||
} else if ((sym->usage & (uWRITTEN | uPUBLIC | uCONST))==0 && sym->ident==iREFARRAY) {
|
||||
errorset(sSETPOS,sym->lnumber);
|
||||
error(214,sym->name); /* make array argument "const" */
|
||||
errorset(sSETPOS,0);
|
||||
errorset(sSETPOS,-1);
|
||||
#endif
|
||||
} /* if */
|
||||
/* also mark the variable (local or global) to the debug information */
|
||||
|
Loading…
x
Reference in New Issue
Block a user