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 */
|
/* temporarily reset the line number to where the symbol was defined */
|
||||||
errorset(sSETPOS,symbolline);
|
errorset(sSETPOS,symbolline);
|
||||||
error(213); /* tagname mismatch */
|
error(213); /* tagname mismatch */
|
||||||
errorset(sSETPOS,0);
|
errorset(sSETPOS,-1);
|
||||||
} /* if */
|
} /* if */
|
||||||
sym=add_constant(constname,val,vclass,tag);
|
sym=add_constant(constname,val,vclass,tag);
|
||||||
if (sym!=NULL)
|
if (sym!=NULL)
|
||||||
@ -4780,7 +4780,7 @@ static int testsymbols(symbol *root,int level,int testlabs,int testconst)
|
|||||||
} else if ((sym->usage & uREAD)==0) {
|
} else if ((sym->usage & uREAD)==0) {
|
||||||
errorset(sSETPOS,sym->lnumber);
|
errorset(sSETPOS,sym->lnumber);
|
||||||
error(203,sym->name); /* symbol isn't used: ... */
|
error(203,sym->name); /* symbol isn't used: ... */
|
||||||
errorset(sSETPOS,0);
|
errorset(sSETPOS,-1);
|
||||||
} /* if */
|
} /* if */
|
||||||
} /* if */
|
} /* if */
|
||||||
break;
|
break;
|
||||||
@ -4800,7 +4800,7 @@ static int testsymbols(symbol *root,int level,int testlabs,int testconst)
|
|||||||
if (testconst && (sym->usage & uREAD)==0) {
|
if (testconst && (sym->usage & uREAD)==0) {
|
||||||
errorset(sSETPOS,sym->lnumber);
|
errorset(sSETPOS,sym->lnumber);
|
||||||
error(203,sym->name); /* symbol isn't used: ... */
|
error(203,sym->name); /* symbol isn't used: ... */
|
||||||
errorset(sSETPOS,0);
|
errorset(sSETPOS,-1);
|
||||||
} /* if */
|
} /* if */
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -4810,16 +4810,16 @@ static int testsymbols(symbol *root,int level,int testlabs,int testconst)
|
|||||||
if ((sym->usage & (uWRITTEN | uREAD | uSTOCK | uPUBLIC))==0) {
|
if ((sym->usage & (uWRITTEN | uREAD | uSTOCK | uPUBLIC))==0) {
|
||||||
errorset(sSETPOS,sym->lnumber);
|
errorset(sSETPOS,sym->lnumber);
|
||||||
error(203,sym->name,sym->lnumber); /* symbol isn't used (and not stock) */
|
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) {
|
} else if ((sym->usage & (uREAD | uSTOCK | uPUBLIC))==0) {
|
||||||
errorset(sSETPOS,sym->lnumber);
|
errorset(sSETPOS,sym->lnumber);
|
||||||
error(204,sym->name); /* value assigned to symbol is never used */
|
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"
|
#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) {
|
} else if ((sym->usage & (uWRITTEN | uPUBLIC | uCONST))==0 && sym->ident==iREFARRAY) {
|
||||||
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,0);
|
errorset(sSETPOS,-1);
|
||||||
#endif
|
#endif
|
||||||
} /* if */
|
} /* if */
|
||||||
/* also mark the variable (local or global) to the debug information */
|
/* also mark the variable (local or global) to the debug information */
|
||||||
|
@ -269,7 +269,7 @@ static short lastfile;
|
|||||||
assert(errstart<=errline);
|
assert(errstart<=errline);
|
||||||
va_start(argptr,number);
|
va_start(argptr,number);
|
||||||
if (strlen(errfname)==0) {
|
if (strlen(errfname)==0) {
|
||||||
int start= (errstart==errline) ? -1 : errstart;
|
int start=(errstart==errline) ? -1 : errstart;
|
||||||
if (pc_error(number,msg,inpfname,start,errline,argptr)) {
|
if (pc_error(number,msg,inpfname,start,errline,argptr)) {
|
||||||
if (outf!=NULL) {
|
if (outf!=NULL) {
|
||||||
pc_closeasm(outf,TRUE);
|
pc_closeasm(outf,TRUE);
|
||||||
@ -356,7 +356,7 @@ int pc_enablewarning(int number,int enable)
|
|||||||
|
|
||||||
if (number<200)
|
if (number<200)
|
||||||
return FALSE; /* errors and fatal errors cannot be disabled */
|
return FALSE; /* errors and fatal errors cannot be disabled */
|
||||||
number -= 200;
|
number-=200;
|
||||||
if (number>=NUM_WARNINGS)
|
if (number>=NUM_WARNINGS)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user