]> 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 93d2a173f9c4a37686229c223e936ac38f7e94a8..cbcfb09d624ab227610a02f03eebfbb9a8a717db 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -1049,7 +1049,7 @@ const char* ast_function_label(ast_function *self, const char *prefix)
     size_t len;
     char  *from;
 
-    if (!opts.dump && !opts.dumpfin)
+    if (!opts.dump && !opts.dumpfin && !opts.debug)
         return NULL;
 
     id  = (self->labelcount++);
@@ -1568,11 +1568,13 @@ bool ast_block_codegen(ast_block *self, ast_function *func, bool lvalue, ir_valu
 
     for (i = 0; i < vec_size(self->exprs); ++i)
     {
-        ast_expression_codegen *gen = self->exprs[i]->expression.codegen;
+        ast_expression_codegen *gen;
         if (func->curblock->final && !ast_istype(self->exprs[i], ast_label)) {
-            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))
             return false;
     }