options_set(opts_warn, WARN_EXTENSIONS, true);
options_set(opts_warn, WARN_FIELD_REDECLARED, true);
options_set(opts_warn, WARN_TOO_FEW_PARAMETERS, true);
+ options_set(opts_warn, WARN_MISSING_RETURN_VALUES, true);
if (!options_parse(argc, argv)) {
return usage();
if (parser->tok != '}') {
block = NULL;
} else {
+ if (parser->function->vtype->expression.next->expression.vtype != TYPE_VOID)
+ {
+ if (!block->exprs_count ||
+ !ast_istype(block->exprs[block->exprs_count-1], ast_return))
+ {
+ parsewarning(parser, WARN_MISSING_RETURN_VALUES, "control reaches end of non-void function");
+ }
+ }
(void)parser_next(parser);
}