mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
warn on return foo (); where foo returns void
This commit is contained in:
parent
fb9c3e6125
commit
ab4f0e7ca9
2 changed files with 5 additions and 2 deletions
|
@ -1949,6 +1949,9 @@ return_expr (function_t *f, expr_t *e)
|
|||
t = &type_float;
|
||||
}
|
||||
if (t == &type_void) {
|
||||
if (!options.traditional)
|
||||
return error (e, "void value not ignored as it ought to be");
|
||||
warning (e, "void value not ignored as it ought to be");
|
||||
t = f->def->type->aux_type;
|
||||
e->type = expr_types[t->type];
|
||||
}
|
||||
|
|
|
@ -1437,8 +1437,8 @@ keywordnamelist
|
|||
;
|
||||
|
||||
keywordname
|
||||
: selector ':' { $$ = new_keywordarg ($1, 0); }
|
||||
| ':' { $$ = new_keywordarg ("", 0); }
|
||||
: selector ':' { $$ = new_keywordarg ($1, new_nil_expr ()); }
|
||||
| ':' { $$ = new_keywordarg ("", new_nil_expr ()); }
|
||||
;
|
||||
|
||||
obj_string
|
||||
|
|
Loading…
Reference in a new issue