shithub: scc

Download patch

ref: 69f974c568329c43b9b199992d43322b8d50e0cc
parent: a0e2bdc94eb6fd60818d9278fe7ab23d223518ae
author: Roberto E. Vargas Caballero <[email protected]>
date: Sun Jul 19 08:03:01 EDT 2015

Warn only in not used and defined symbols

Sometimes some symbols are created but they are not defined,
like for example parameters of macros or when a symbol is looked
up in the wrong namespace.

--- a/cc1/symbol.c
+++ b/cc1/symbol.c
@@ -85,8 +85,9 @@
 			break;
 		}
 		if (sym->name) {
+			short f = sym->flags;
 			htab[hash(sym->name)] = sym->hash;
-			if ((sym->flags & (ISUSED|ISGLOBAL)) == 0)
+			if ((f & (ISUSED|ISGLOBAL|ISDEFINED)) == ISDEFINED)
 				warn("'%s' defined but not used", sym->name);
 		}
 		free(sym->name);