scc

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

commit 1ad6eb865750ec1c626341f349228919364cb552
parent 6a98886da0c2c8b15616e2da8033c938a528c715
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed,  3 Jul 2013 16:52:02 +0200

Remove unneeded goto in spec

We can use in this case the direct call instead of the gotos.

Diffstat:
decl.c | 8++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/decl.c b/decl.c @@ -79,9 +79,9 @@ spec(register struct ctype *cp) cp->c_unsigned = 1; case SIGNED: if (sign == yytoken) - goto duplicated; + error("duplicated '%s'", yytext); if (sign) - goto signed_and_unsigned; + error("both 'signed' and 'unsigned' in declaration specifiers"); sign = yytoken; break; case VOID: case CHAR: case SHORT: case INT: @@ -97,10 +97,6 @@ spec(register struct ctype *cp) return n; } } -duplicated: - error("duplicated '%s'", yytext); -signed_and_unsigned: - error("both 'signed' and 'unsigned' in declaration specifiers"); } static void