mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 12:52:46 +00:00
Generate a warning when creating a var with no type.
This makes the internal error in new_def() non-functional, but the warning will catch the bug and there's no harm in leaving the test in new_def().
This commit is contained in:
parent
ee866ae3a6
commit
4c63a0bad6
1 changed files with 5 additions and 0 deletions
|
@ -182,6 +182,11 @@ void
|
|||
initialize_def (symbol_t *sym, type_t *type, expr_t *init, defspace_t *space,
|
||||
storage_class_t storage)
|
||||
{
|
||||
if (!type) {
|
||||
warning (0, "type for %s defaults to %s", sym->name,
|
||||
type_default->name);
|
||||
type = type_default;
|
||||
}
|
||||
if (sym->table == current_symtab) {
|
||||
if (sym->sy_type != sy_var || sym->type != type) {
|
||||
error (0, "%s redefined", sym->name);
|
||||
|
|
Loading…
Reference in a new issue