[hackers] [scc] [cc1] Re-emit tentative definitions || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Thu, 28 Jan 2016 08:49:39 +0100 (CET)

commit 298b9d10ce37f28fa4e09a13df94835de354d696
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Thu Jan 28 08:17:19 2016 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Thu Jan 28 08:17:19 2016 +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.

diff --git a/cc1/init.c b/cc1/init.c
index 6b38a7a..2464bbd 100644
--- a/cc1/init.c
+++ b/cc1/init.c
_AT_@ -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
index 44c1614..3b27423 100644
--- a/cc1/tests/test038.c
+++ b/cc1/tests/test038.c
_AT_@ -6,7 +6,7 @@ error:
 test038.c:43: error: redeclaration of 'x'
 output:
 G1 I "x
- (
+G1 I "x (
         #I0
 )
 G5 F "foo
Received on Thu Jan 28 2016 - 08:49:39 CET

This archive was generated by hypermail 2.3.0 : Thu Jan 28 2016 - 09:00:21 CET