mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-17 22:50:51 +00:00
make return type missmatch a warning for --traditional
This commit is contained in:
parent
12c970496d
commit
aec0c9eea1
1 changed files with 7 additions and 3 deletions
|
@ -1941,9 +1941,13 @@ return_expr (function_t *f, expr_t *e)
|
|||
t = f->def->type->aux_type;
|
||||
e->type = expr_types[t->type];
|
||||
}
|
||||
if (!type_assignable (f->def->type->aux_type, t))
|
||||
return error (e, "type mismatch for return value of %s",
|
||||
f->def->name);
|
||||
if (!type_assignable (f->def->type->aux_type, t)) {
|
||||
if (!options.traditional)
|
||||
return error (e, "type mismatch for return value of %s",
|
||||
f->def->name);
|
||||
warning (e, "type mismatch for return value of %s",
|
||||
f->def->name);
|
||||
}
|
||||
}
|
||||
return new_unary_expr ('r', e);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue