mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-04-25 11:01:16 +00:00
warn when a top-level local shadows a parameter
This commit is contained in:
parent
70194567fe
commit
e38259e01f
1 changed files with 7 additions and 1 deletions
|
@ -312,8 +312,14 @@ def_name
|
||||||
{
|
{
|
||||||
int *alloc = &numpr_globals;
|
int *alloc = &numpr_globals;
|
||||||
|
|
||||||
if (pr_scope)
|
if (pr_scope) {
|
||||||
alloc = pr_scope->alloc;
|
alloc = pr_scope->alloc;
|
||||||
|
if (pr_scope->scope && !pr_scope->scope->scope) {
|
||||||
|
def_t *def = PR_GetDef (0, $1, pr_scope->scope, 0);
|
||||||
|
if (def && def->scope && !def->scope->scope)
|
||||||
|
warning (0, "local %s shadows param %s", $1, def->name);
|
||||||
|
}
|
||||||
|
}
|
||||||
$$ = PR_GetDef (current_type, $1, pr_scope, alloc);
|
$$ = PR_GetDef (current_type, $1, pr_scope, alloc);
|
||||||
current_def = $$;
|
current_def = $$;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue