commit 12da403dac1d4581566efa3a72e98b04dd828395
parent 7ab5856146a046a2f8a2fedd19375a23be1690f2
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Tue, 8 Jul 2014 14:36:39 +0200
Remove unneded gotos in fielddcl
These gotos were added only to save some bytes in error handling.
These patch removes them and make the code cleaner.
Diffstat:
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/cc1/decl.c b/cc1/decl.c
@@ -289,17 +289,16 @@ fielddcl(Type *base)
{
Type *tp;
Symbol *sym;
- char *err;
switch (yytoken) {
case SCLASS:
- goto bad_storage;
+ error("storage class '%s' in struct/union field", yytext);
case IDEN: case TYPE: case TQUALIFIER:
tp = specifier(NULL);
case ';':
break;
default:
- goto dcl_expected;
+ error("declaration expected");
}
if (yytoken != ';') {
@@ -311,14 +310,6 @@ fielddcl(Type *base)
expect(';');
return;
-
-bad_storage:
- err = "storage class '%s' in struct/union field";
- goto error;
-dcl_expected:
- err = "declaration expected";
-error:
- error(err, yytext);
}
static Type *