scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 24f5b053a44666a9fa66c8ed71cedb797b621b3d
parent 9c48f641a47824a9759e93675d4e2e3c60786758
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed, 14 Dec 2016 14:58:42 +0100

[cc1] Use NS_DUMMY instead of 0

Symbols defined in the scope of a type name must not hide
any symbol in any namespace, so the best solution is to
use a non valid namespace. NS_DUMMY is a better representation
than 0 for it.

Diffstat:
Mcc1/cc1.h | 3++-
Mcc1/decl.c | 2+-
2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/cc1/cc1.h b/cc1/cc1.h @@ -62,7 +62,8 @@ enum { /* namespaces */ enum { - NS_IDEN = 1, + NS_DUMMY, + NS_IDEN, NS_TAG, NS_LABEL, NS_CPP, diff --git a/cc1/decl.c b/cc1/decl.c @@ -924,5 +924,5 @@ fieldlist(Type *tp) Type * typename(void) { - return dodcl(NOREP, type, 0, NULL)->type; + return dodcl(NOREP, type, NS_DUMMY, NULL)->type; }