]> de.git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ast.c
-Werror-<warning> should actually use opts_setwerror
[xonotic/gmqcc.git] / ast.c
diff --git a/ast.c b/ast.c
index 5cb8651d6d5b1e9428c5e3824ee26ce631e277ce..cbcfb09d624ab227610a02f03eebfbb9a8a717db 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -1570,10 +1570,9 @@ bool ast_block_codegen(ast_block *self, ast_function *func, bool lvalue, ir_valu
     {
         ast_expression_codegen *gen;
         if (func->curblock->final && !ast_istype(self->exprs[i], ast_label)) {
-            if (OPTS_FLAG(ALLOW_UNREACHABLE_CODE))
-                continue;
-            compile_error(ast_ctx(self->exprs[i]), "unreachable statement");
-            return false;
+            if (compile_warning(ast_ctx(self->exprs[i]), WARN_UNREACHABLE_CODE, "unreachable statement"))
+                return false;
+            continue;
         }
         gen = self->exprs[i]->expression.codegen;
         if (!(*gen)(self->exprs[i], func, false, out))