diff --git a/tools/qfcc/source/qc-parse.y b/tools/qfcc/source/qc-parse.y index b02e49426..49465ef13 100644 --- a/tools/qfcc/source/qc-parse.y +++ b/tools/qfcc/source/qc-parse.y @@ -461,7 +461,7 @@ enum_specifier ; optional_enum_list - : '{' enum_init enumerator_list optional_comma '}' { $$ = $2; } + : enum_list | /* empty */ { $$ = find_enum ($0); } ; diff --git a/tools/qfcc/source/struct.c b/tools/qfcc/source/struct.c index 1d2670791..c202af075 100644 --- a/tools/qfcc/source/struct.c +++ b/tools/qfcc/source/struct.c @@ -130,6 +130,7 @@ build_struct (int su, symbol_t *tag, symtab_t *symtab, type_t *type) } sym->sy_type = sy_type; sym->type->t.symtab = symtab; + sym->type = find_type (sym->type); return sym; } @@ -147,6 +148,7 @@ start_enum (symbol_t *sym) sym = find_enum (0); } sym->type->t.symtab = new_symtab (current_symtab, stab_local); + sym->type = find_type (sym->type); return sym->type->t.symtab; }