Fixed amb363 - Compiler reports wrong line number for unused global symbols

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40882
This commit is contained in:
Scott Ehlert 2007-06-05 05:45:48 +00:00
parent a3687d9258
commit 2884483bef

View File

@ -5098,9 +5098,8 @@ static int testsymbols(symbol *root,int level,int testlabs,int testconst)
if (sym->parent!=NULL)
break; /* hierarchical data type */
if ((sym->usage & (uWRITTEN | uREAD | uSTOCK))==0) {
if (testconst)
errorset(sSETPOS,sym->lnumber);
error(203,sym->name,sym->lnumber); /* symbol isn't used (and not stock) */
errorset(sSETPOS,sym->lnumber);
error(203,sym->name); /* symbol isn't used (and not stock) */
} else if ((sym->usage & (uREAD | uSTOCK | uPUBLIC))==0) {
errorset(sSETPOS,sym->lnumber);
error(204,sym->name); /* value assigned to symbol is never used */