[hackers] [scc] Fix declaration of structs, unions and enums || Roberto E. Vargas Caballero
commit 0e78d39ed924847e4e78662581c43ffdbe0d1ef4
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Wed Jul 22 08:58:12 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Wed Jul 22 08:58:12 2015 +0200
Fix declaration of structs, unions and enums
Another specifiers are not allowed after a struct/unions/enums
diff --git a/cc1/decl.c b/cc1/decl.c
index 3cbe432..1e18d61 100644
--- a/cc1/decl.c
+++ b/cc1/decl.c
_AT_@ -216,11 +216,13 @@ specifier(unsigned *sclass)
switch (yylval.token) {
case ENUM:
dcl = enumdcl;
- p = &type; break;
+ p = &type;
+ break;
case STRUCT:
case UNION:
dcl = structdcl;
- p = &type; break;
+ p = &type;
+ break;
case VOID:
case BOOL:
case CHAR:
_AT_@ -231,7 +233,8 @@ specifier(unsigned *sclass)
break;
case SIGNED:
case UNSIGNED:
- p = &sign; break;
+ p = &sign;
+ break;
case LONG:
if (size == LONG) {
size = LLONG;
_AT_@ -252,6 +255,7 @@ specifier(unsigned *sclass)
if (size || sign)
goto invalid_type;
tp = (*dcl)();
+ goto return_type;
} else {
next();
}
Received on Wed Jul 22 2015 - 18:01:42 CEST
This archive was generated by hypermail 2.3.0
: Wed Jul 22 2015 - 18:12:13 CEST