From: Dale Weiler Date: Thu, 24 Nov 2016 15:50:48 +0000 (+0000) Subject: Just mark LOCAL_RETURN noref instead of checking for '#' in the name X-Git-Tag: xonotic-v0.8.5~48 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=commitdiff_plain;h=17c0812ae48533e4207dd9ffc5408f781020ce97 Just mark LOCAL_RETURN noref instead of checking for '#' in the name --- diff --git a/ir.cpp b/ir.cpp index 3b78c35..f5bc452 100644 --- a/ir.cpp +++ b/ir.cpp @@ -656,8 +656,7 @@ bool ir_function_finalize(ir_function *self) return false; } // just a standard variable - else if (v->m_name[0] != '#' - && irwarning(v->m_context, WARN_UNUSED_VARIABLE, + else if (irwarning(v->m_context, WARN_UNUSED_VARIABLE, "unused variable: `%s`", v->m_name.c_str())) return false; } } diff --git a/parser.cpp b/parser.cpp index ed5bde1..e365316 100644 --- a/parser.cpp +++ b/parser.cpp @@ -2630,6 +2630,7 @@ static bool parse_return(parser_t *parser, ast_block *block, ast_expression **ou retval = new ast_value(ctx, "#LOCAL_RETURN", TYPE_VOID); retval->adoptType(*expected->m_next); parser->function->m_return_value = retval; + parser->function->m_return_value->m_flags |= AST_FLAG_NOREF; } if (!exp->compareType(*retval)) {