mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
[qfcc] Accept "struct foo; struct foo { ... };"
That is, do not treat structure definition after declaration to be a redefinition.
This commit is contained in:
parent
d91289ea1b
commit
e33d83fc9e
1 changed files with 12 additions and 3 deletions
|
@ -610,9 +610,18 @@ struct_specifier
|
|||
if (!sym->table) {
|
||||
symtab_addsymbol (current_symtab, sym);
|
||||
} else {
|
||||
error (0, "%s %s redefined", $1 == 's' ? "struct" : "union",
|
||||
$2->name);
|
||||
$1 = 0;
|
||||
if (!sym->type) {
|
||||
internal_error (0, "broken structure symbol?");
|
||||
}
|
||||
if (sym->type->meta == ty_enum
|
||||
|| (sym->type->meta == ty_struct && sym->type->t.symtab)) {
|
||||
error (0, "%s %s redefined",
|
||||
$1 == 's' ? "struct" : "union", $2->name);
|
||||
$1 = 0;
|
||||
} else if (sym->type->meta != ty_struct) {
|
||||
internal_error (0, "%s is not a struct or union",
|
||||
$2->name);
|
||||
}
|
||||
}
|
||||
current_symtab = new_symtab (current_symtab, stab_local);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue