scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 7aa7271a9ad01e7368fffa0c5d7426e86a696dcb
parent 1c72bb640a82a82459a4224efeea82fde5faa22b
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sun, 16 Nov 2014 06:27:22 -0500

Make symbols defined by default

The common case is define symbols defined, except in the case of
labels and in extern. This patch makes symbols defined by default.

Diffstat:
Mcc1/decl.c | 2--
Mcc1/symbol.c | 2+-
2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/cc1/decl.c b/cc1/decl.c @@ -414,7 +414,6 @@ decl(void) do { sym = declarator(tp, ID_EXPECTED, NS_IDEN); - sym->s.isdefined = 1; isfun = sym->type->op == FTN; switch (sclass) { @@ -484,7 +483,6 @@ extdecl(void) tp = sym->type; sym->s.isstatic = 1; sym->s.isglobal= 1; - sym->s.isdefined = 1; switch (sclass) { case REGISTER: case AUTO: diff --git a/cc1/symbol.c b/cc1/symbol.c @@ -90,7 +90,7 @@ install(char *s, uint8_t ns) sym->ctx = curctx; sym->token = IDEN; sym->id = (curctx) ? ++localcnt : ++globalcnt; - sym->s.isdefined = 0; + sym->s.isdefined = 1; sym->ns = ns; tbl = &symtab[(ns > NS_STRUCTS) ? NS_STRUCTS : ns]; sym->next = tbl->head;