mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-04-15 05:41:59 +00:00
[qfcc] Report correct type in enum/struct redefinitions
Enums are neither unions or structs.
This commit is contained in:
parent
6d9e2bd926
commit
4b369be8c1
1 changed files with 10 additions and 9 deletions
|
@ -113,17 +113,18 @@ start_struct (int *su, symbol_t *tag, symtab_t *parent)
|
|||
if (tag) {
|
||||
tag->type = sym->type;
|
||||
}
|
||||
if (sym->type->meta == ty_enum
|
||||
|| (sym->type->meta == ty_struct && sym->type->symtab)) {
|
||||
if (sym->type->meta == ty_enum) {
|
||||
error (0, "enum %s redefined", tag->name);
|
||||
} else if (sym->type->meta == ty_struct && sym->type->symtab) {
|
||||
error (0, "%s %s redefined",
|
||||
*su == 's' ? "struct" : "union", tag->name);
|
||||
*su = 0;
|
||||
} else if (sym->type->meta != ty_struct) {
|
||||
internal_error (0, "%s is not a struct or union",
|
||||
tag->name);
|
||||
}
|
||||
}
|
||||
return new_symtab (parent, stab_struct);
|
||||
*su = 0;
|
||||
} else if (sym->type->meta != ty_struct) {
|
||||
internal_error (0, "%s is not a struct or union",
|
||||
tag->name);
|
||||
}
|
||||
}
|
||||
return new_symtab (parent, stab_struct);
|
||||
}
|
||||
|
||||
symbol_t *
|
||||
|
|
Loading…
Reference in a new issue