]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
-Wmissing-return-values, off by default, ignored with -std=gmqcc because in that...
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 18 Aug 2012 18:19:43 +0000 (20:19 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 18 Aug 2012 18:19:43 +0000 (20:19 +0200)
parser.c
warns.def

index 7ef5c9b43085efd410c51d17fed63cd62df5e50d..1e8851734768a8c7934764742e1930abfbf91295 100644 (file)
--- 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);
             }
index 3136956650b4498884b9e20cbcfd967eb93ce397..030e938d03e304c9588fe74222003002ebccb618 100644 (file)
--- 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)