shithub: scc

Download patch

ref: 808ce90786c3b900eeaa6a5048c26838e7d0e456
parent: c9c87cb432cb4e479089fe8520c03cc1ca9f82e0
author: Roberto E. Vargas Caballero <[email protected]>
date: Tue May 13 14:19:31 EDT 2014

Simplpify enum constant declaration

We know that fields of struct or union can not have the same value
of id, so we can remove the type check in fielddcl.

--- a/cc1/decl.c
+++ b/cc1/decl.c
@@ -270,7 +270,7 @@
 		t = p->name;
 		if (*s == *t && !strcmp(s, t))
 			goto duplicated_name;
-		if (op == ENUM && sym->u.i == p->id)
+		if (sym->u.i == p->id)
 			goto duplicated_value;
 	}