mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
better error reporting for redefines
This commit is contained in:
parent
a521a78adb
commit
680bc22697
2 changed files with 5 additions and 2 deletions
|
@ -105,7 +105,11 @@ check_for_name (type_t *type, const char *name, scope_t *scope,
|
|||
if (def) {
|
||||
if (storage != st_none && scope == def->scope)
|
||||
if (type && def->type != type) {
|
||||
expr_t *e = new_expr ();
|
||||
e->line = def->line;
|
||||
e->file = def->file;
|
||||
error (0, "Type mismatch on redeclaration of %s", name);
|
||||
error (e, "previous declaration");
|
||||
}
|
||||
if (storage == st_none || def->scope == scope)
|
||||
return def;
|
||||
|
|
|
@ -189,8 +189,7 @@ get_function (const char *name, type_t *type, int overload, int create)
|
|||
e->file = func->file;
|
||||
warning (0, "creating overloaded function %s without @overload",
|
||||
full_name);
|
||||
warning (e, "(previous function is %s)",
|
||||
func->full_name);
|
||||
warning (e, "(previous function is %s)", func->full_name);
|
||||
}
|
||||
overload = 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue