mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 22:22:17 +00:00
-Wmissing-return-values, off by default, ignored with -std=gmqcc because in that standard it'll error
This commit is contained in:
parent
588cd5018f
commit
6223d78ee3
2 changed files with 5 additions and 1 deletions
5
parser.c
5
parser.c
|
@ -1616,7 +1616,10 @@ static bool parser_parse_statement(parser_t *parser, ast_block *block, ast_expre
|
|||
if (!parser_next(parser))
|
||||
parseerror(parser, "parse error");
|
||||
if (expected->expression.next->expression.vtype != TYPE_VOID) {
|
||||
parseerror(parser, "return without value");
|
||||
if (opts_standard != COMPILER_GMQCC)
|
||||
parsewarning(parser, WARN_MISSING_RETURN_VALUES, "return without value");
|
||||
else
|
||||
parseerror(parser, "return without value");
|
||||
}
|
||||
ret = ast_return_new(parser_ctx(parser), NULL);
|
||||
}
|
||||
|
|
|
@ -7,3 +7,4 @@ GMQCC_DEFINE_FLAG(UNUSED_VARIABLE)
|
|||
GMQCC_DEFINE_FLAG(UNKNOWN_CONTROL_SEQUENCE)
|
||||
GMQCC_DEFINE_FLAG(EXTENSIONS)
|
||||
GMQCC_DEFINE_FLAG(FIELD_REDECLARED)
|
||||
GMQCC_DEFINE_FLAG(MISSING_RETURN_VALUES)
|
||||
|
|
Loading…
Reference in a new issue