[hackers] [scc] [cc1] Fix redeclaration of tags || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Wed, 28 Sep 2016 11:34:55 +0200 (CEST)

commit 44123dfb36d1c0ba6b428d89a870679f4f7ff86e
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Wed Sep 28 11:32:54 2016 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Wed Sep 28 11:32:54 2016 +0200

    [cc1] Fix redeclaration of tags
    
    A tag can be redeclared if the context of both declarations is different.

diff --git a/cc1/decl.c b/cc1/decl.c
index 20df8fd..05677ab 100644
--- a/cc1/decl.c
+++ b/cc1/decl.c
_AT_@ -519,7 +519,7 @@ structdcl(void)
                 return tp;
         }
 
- if (tp->prop & TDEFINED)
+ if (tp->prop & TDEFINED && sym->ctx == curctx)
                 error("redefinition of struct/union '%s'", sym->name);
         tp->prop |= TDEFINED;
 
Received on Wed Sep 28 2016 - 11:34:55 CEST

This archive was generated by hypermail 2.3.0 : Wed Sep 28 2016 - 11:36:16 CEST