shithub: scc

Download patch

ref: 09c4bb6363f3ccc3c8835bcdf44bd6a42a564844
parent: 978f166ff682be738e5374ec004e404ce58a5e16
author: Roberto E. Vargas Caballero <[email protected]>
date: Wed Dec 14 09:58:42 EST 2016

[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.

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