]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
fixed -Wconditional-uninitialized for ast codegen
authorDale Weiler <killfieldengine@gmail.com>
Thu, 7 Jun 2012 15:12:12 +0000 (11:12 -0400)
committerDale Weiler <killfieldengine@gmail.com>
Thu, 7 Jun 2012 15:12:12 +0000 (11:12 -0400)
Makefile
ast.c

index fe0f5fc3ff5b3b08b60fb091f7739b20ae50762a..4ff71b44687ba2f7236078e0b68594073a4ac9e3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,6 @@ ifeq ($(CC), clang)
                -Wno-disabled-macro-expansion \
                -Wno-padded \
                -Wno-undef \
-               -Wno-conditional-uninitialized \
                -Wno-format-nonliteral
 
 endif
diff --git a/ast.c b/ast.c
index acffbdc442fe1108303186087e44d63bffec252c..f12c57431344ec4b1cf2cee276ec4941acc21a2a 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -925,31 +925,31 @@ bool ast_loop_codegen(ast_loop *self, ast_function *func, bool lvalue, ir_value
 {
     ast_expression_codegen *cgen;
 
-    ir_value *dummy;
-    ir_value *precond;
-    ir_value *postcond;
+    ir_value *dummy      = NULL;
+    ir_value *precond    = NULL;
+    ir_value *postcond   = NULL;
 
     /* Since we insert some jumps "late" so we have blocks
      * ordered "nicely", we need to keep track of the actual end-blocks
      * of expressions to add the jumps to.
      */
-    ir_block *bbody,      *end_bbody;
-    ir_block *bprecond,   *end_bprecond;
-    ir_block *bpostcond,  *end_bpostcond;
-    ir_block *bincrement, *end_bincrement;
-    ir_block *bout, *bin;
+    ir_block *bbody      = NULL, *end_bbody      = NULL;
+    ir_block *bprecond   = NULL, *end_bprecond   = NULL;
+    ir_block *bpostcond  = NULL, *end_bpostcond  = NULL;
+    ir_block *bincrement = NULL, *end_bincrement = NULL;
+    ir_block *bout       = NULL, *bin            = NULL;
 
     /* let's at least move the outgoing block to the end */
     size_t    bout_id;
 
     /* 'break' and 'continue' need to be able to find the right blocks */
-    ir_block *bcontinue = NULL;
-    ir_block *bbreak    = NULL;
+    ir_block *bcontinue     = NULL;
+    ir_block *bbreak        = NULL;
 
-    ir_block *old_bcontinue;
-    ir_block *old_bbreak;
+    ir_block *old_bcontinue = NULL;
+    ir_block *old_bbreak    = NULL;
 
-    ir_block *tmpblock;
+    ir_block *tmpblock      = NULL;
 
     (void)lvalue;
     (void)out;