shithub: scc

Download patch

ref: cbdbbf1076c80ffe2281b687d6539905c485c49b
parent: 41765c098e17137abaa8f9e65858b4d03c99db47
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sat Jan 9 16:30:08 EST 2016

Mark as defined local variables

Declaration of local variables also means definition.

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