scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit 808ce90786c3b900eeaa6a5048c26838e7d0e456
parent c9c87cb432cb4e479089fe8520c03cc1ca9f82e0
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 13 May 2014 18:19:31 +0200

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.

Diffstat:
cc1/decl.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cc1/decl.c b/cc1/decl.c @@ -270,7 +270,7 @@ newfield(Type *tp, Symbol *sym) 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; }