Don't remove unused public variables
But still warn about them unless they are marked as stock. Fixes #71
This commit is contained in:
parent
88f78aa882
commit
d8f824357f
@ -1976,7 +1976,7 @@ static void declglb(char *firstname,int firsttag,int fpublic,int fstatic,int fst
|
|||||||
* second stage), shut off code generation
|
* second stage), shut off code generation
|
||||||
*/
|
*/
|
||||||
cidx=0; /* only to avoid a compiler warning */
|
cidx=0; /* only to avoid a compiler warning */
|
||||||
if (sc_status==statWRITE && sym!=NULL && (sym->usage & (uREAD | uWRITTEN))==0) {
|
if (sc_status==statWRITE && sym!=NULL && (sym->usage & (uREAD | uWRITTEN | uPUBLIC))==0) {
|
||||||
sc_status=statSKIP;
|
sc_status=statSKIP;
|
||||||
cidx=code_idx;
|
cidx=code_idx;
|
||||||
#if !defined NDEBUG
|
#if !defined NDEBUG
|
||||||
|
@ -747,7 +747,7 @@ SC_FUNC int assemble(FILE *fout,FILE *fin)
|
|||||||
mainaddr=sym->addr;
|
mainaddr=sym->addr;
|
||||||
} /* if */
|
} /* if */
|
||||||
} else if (sym->ident==iVARIABLE) {
|
} else if (sym->ident==iVARIABLE) {
|
||||||
if ((sym->usage & uPUBLIC)!=0 && (sym->usage & (uREAD | uWRITTEN))!=0)
|
if ((sym->usage & uPUBLIC)!=0)
|
||||||
match=++numpubvars;
|
match=++numpubvars;
|
||||||
} /* if */
|
} /* if */
|
||||||
if (match) {
|
if (match) {
|
||||||
@ -924,7 +924,7 @@ SC_FUNC int assemble(FILE *fout,FILE *fin)
|
|||||||
/* write the public variables table */
|
/* write the public variables table */
|
||||||
count=0;
|
count=0;
|
||||||
for (sym=glbtab.next; sym!=NULL; sym=sym->next) {
|
for (sym=glbtab.next; sym!=NULL; sym=sym->next) {
|
||||||
if (sym->ident==iVARIABLE && (sym->usage & uPUBLIC)!=0 && (sym->usage & (uREAD | uWRITTEN))!=0) {
|
if (sym->ident==iVARIABLE && (sym->usage & uPUBLIC)!=0) {
|
||||||
assert((sym->usage & uDEFINE)!=0);
|
assert((sym->usage & uDEFINE)!=0);
|
||||||
assert(sym->vclass==sGLOBAL);
|
assert(sym->vclass==sGLOBAL);
|
||||||
func.address=sym->addr;
|
func.address=sym->addr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user