scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

commit 595745d66b60c94b34f1286986ce9dbefa08d0f4
parent ae8d51718664aa49b07acb535569362aa71c94b2
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon,  7 Jan 2019 18:16:05 +0000

[nm] Restore filter

Last commit remove the filter expressions and this commit
restore them.

Diffstat:
Msrc/nm/nm.c | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/nm/nm.c b/src/nm/nm.c @@ -119,6 +119,16 @@ newsym(Symbol *sym, void *data) struct symtbl *tbl = data; Symbol **p; size_t n, size; + int type = sym->type; + + if (type == '?' || type == 'N') + return 1; + + if (uflag && type != 'U') + return 1; + + if (gflag && !isupper(type)) + return 1; n = tbl->nsyms+1; if (n == 0 || n > SIZE_MAX / sizeof(*p))