commit 298b9d10ce37f28fa4e09a13df94835de354d696
parent 80847b8fce363a8f18ed50697d1133c7c769fb1d
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Thu, 28 Jan 2016 08:17:19 +0100
[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.
Diffstat:
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/cc1/init.c b/cc1/init.c
@@ -308,6 +308,7 @@ initializer(Symbol *sym, Type *tp)
return;
}
sym->flags |= HASINIT;
+ sym->flags &= ~ISEMITTED;
emit(ODECL, sym);
emit(OINIT, np);
sym->flags |= ISDEFINED;
diff --git a/cc1/tests/test038.c b/cc1/tests/test038.c
@@ -6,7 +6,7 @@ error:
test038.c:43: error: redeclaration of 'x'
output:
G1 I "x
- (
+G1 I "x (
#I0
)
G5 F "foo