-std=gmqcc now implies -Werror-missing-return-values; another hardcoded error removed

This commit is contained in:
Wolfgang Bumiller 2012-12-31 12:37:47 +01:00
parent 17951ac92c
commit d8254cede0
2 changed files with 2 additions and 4 deletions

1
main.c
View file

@ -164,6 +164,7 @@ static bool options_parse(int argc, char **argv) {
opts_set(opts.flags, TRUE_EMPTY_STRINGS, true);
opts_set(opts.flags, LOOP_LABELS, true);
opts_set(opts.werror, WARN_INVALID_PARAMETER_COUNT, true);
opts_set(opts.werror, WARN_MISSING_RETURN_VALUES, true);
opts.standard = COMPILER_GMQCC;
} else if (!strcmp(argarg, "qcc")) {

View file

@ -2534,10 +2534,7 @@ static bool parse_return(parser_t *parser, ast_block *block, ast_expression **ou
if (!parser_next(parser))
parseerror(parser, "parse error");
if (expected->expression.next->expression.vtype != TYPE_VOID) {
if (opts.standard != COMPILER_GMQCC)
(void)!parsewarning(parser, WARN_MISSING_RETURN_VALUES, "return without value");
else
parseerror(parser, "return without value");
}
ret = ast_return_new(ctx, NULL);
}