commit 69f974c568329c43b9b199992d43322b8d50e0cc
parent a0e2bdc94eb6fd60818d9278fe7ab23d223518ae
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Sun, 19 Jul 2015 12:03:01 +0200
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.
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/cc1/symbol.c b/cc1/symbol.c
@@ -85,8 +85,9 @@ popctx(void)
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);