shithub: scc

Download patch

ref: 298b9d10ce37f28fa4e09a13df94835de354d696
parent: 80847b8fce363a8f18ed50697d1133c7c769fb1d
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Thu Jan 28 03:17:19 EST 2016

[cc1] Re-emit tentative definitions

We need '(' at the end of definitions with initializer, but we cannot have it
if we don't emit again the definition.

--- a/cc1/init.c
+++ b/cc1/init.c
@@ -308,6 +308,7 @@
 			return;
 		}
 		sym->flags |= HASINIT;
+		sym->flags &= ~ISEMITTED;
 		emit(ODECL, sym);
 		emit(OINIT, np);
 		sym->flags |= ISDEFINED;
--- a/cc1/tests/test038.c
+++ b/cc1/tests/test038.c
@@ -6,7 +6,7 @@
 test038.c:43: error: redeclaration of 'x'
 output:
 G1	I	"x
-	(
+G1	I	"x	(
 	#I0
 )
 G5	F	"foo