mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-30 15:41:12 +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
3
parser.c
3
parser.c
|
@ -1616,6 +1616,9 @@ static bool parser_parse_statement(parser_t *parser, ast_block *block, ast_expre
|
||||||
if (!parser_next(parser))
|
if (!parser_next(parser))
|
||||||
parseerror(parser, "parse error");
|
parseerror(parser, "parse error");
|
||||||
if (expected->expression.next->expression.vtype != TYPE_VOID) {
|
if (expected->expression.next->expression.vtype != TYPE_VOID) {
|
||||||
|
if (opts_standard != COMPILER_GMQCC)
|
||||||
|
parsewarning(parser, WARN_MISSING_RETURN_VALUES, "return without value");
|
||||||
|
else
|
||||||
parseerror(parser, "return without value");
|
parseerror(parser, "return without value");
|
||||||
}
|
}
|
||||||
ret = ast_return_new(parser_ctx(parser), NULL);
|
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(UNKNOWN_CONTROL_SEQUENCE)
|
||||||
GMQCC_DEFINE_FLAG(EXTENSIONS)
|
GMQCC_DEFINE_FLAG(EXTENSIONS)
|
||||||
GMQCC_DEFINE_FLAG(FIELD_REDECLARED)
|
GMQCC_DEFINE_FLAG(FIELD_REDECLARED)
|
||||||
|
GMQCC_DEFINE_FLAG(MISSING_RETURN_VALUES)
|
||||||
|
|
Loading…
Reference in a new issue