scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit cbdbbf1076c80ffe2281b687d6539905c485c49b
parent 41765c098e17137abaa8f9e65858b4d03c99db47
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sat,  9 Jan 2016 21:30:08 +0100

Mark as defined local variables

Declaration of local variables also means definition.

Diffstat:
cc1/decl.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/cc1/decl.c b/cc1/decl.c @@ -726,6 +726,8 @@ identifier(struct decl *dcl) emit(ODECL, sym); if (accept('=')) initializer(sym, sym->type, -1); + if (!(sym->flags & (ISGLOBAL|ISEXTERN)) && tp->op != FTN) + sym->flags |= ISDEFINED; return sym; }