mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 06:51:47 +00:00
returning value for void function now a warning for traditional
This commit is contained in:
parent
64a9a8199c
commit
2a5ac8c42d
1 changed files with 5 additions and 2 deletions
|
@ -1934,8 +1934,11 @@ return_expr (function_t *f, expr_t *e)
|
||||||
|
|
||||||
if (e->type == ex_error)
|
if (e->type == ex_error)
|
||||||
return e;
|
return e;
|
||||||
if (f->def->type->aux_type == &type_void)
|
if (f->def->type->aux_type == &type_void) {
|
||||||
|
if (!options.traditional)
|
||||||
return error (e, "returning a value for a void function");
|
return error (e, "returning a value for a void function");
|
||||||
|
warning (e, "returning a value for a void function");
|
||||||
|
}
|
||||||
if (f->def->type->aux_type == &type_float && e->type == ex_integer) {
|
if (f->def->type->aux_type == &type_float && e->type == ex_integer) {
|
||||||
e->type = ex_float;
|
e->type = ex_float;
|
||||||
e->e.float_val = e->e.integer_val;
|
e->e.float_val = e->e.integer_val;
|
||||||
|
|
Loading…
Reference in a new issue