From: Wolfgang (Blub) Bumiller Date: Sat, 18 Aug 2012 18:19:43 +0000 (+0200) Subject: -Wmissing-return-values, off by default, ignored with -std=gmqcc because in that... X-Git-Tag: 0.1-rc1~182 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6223d78ee346a262d4535c4f561b804b5f4bfaab;p=xonotic%2Fgmqcc.git -Wmissing-return-values, off by default, ignored with -std=gmqcc because in that standard it'll error --- diff --git a/parser.c b/parser.c index 7ef5c9b..1e88517 100644 --- a/parser.c +++ b/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); } diff --git a/warns.def b/warns.def index 3136956..030e938 100644 --- a/warns.def +++ b/warns.def @@ -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)