authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-09-05 16:18:49-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-09-05 16:18:49-04:00
log4979e606c36fdca886f82b0dd8c0db17374ab8f6
tree0ea4b7daf7c89dd075221648518f06e1694ee02d
parent20eb749ad6983d74ce8285a725d84248d41fca00

fix gcc 5.4.0compile errors


3 files changed, 4 insertions(+), 4 deletions(-)

src/analyze.cpp+1-1
...@@ -6026,7 +6026,7 @@ static TypeTableEntry *analyze_switch_expr(CodeGen *g, ImportTableEntry *import,...@@ -6026,7 +6026,7 @@ static TypeTableEntry *analyze_switch_expr(CodeGen *g, ImportTableEntry *import,
60266026
60276027
6028 int *field_use_counts = nullptr;6028 int *field_use_counts = nullptr;
6029 HashMap<int, AstNode *, int_hash, int_eq> err_use_nodes;6029 HashMap<int, AstNode *, int_hash, int_eq> err_use_nodes = {};
6030 if (expr_type->id == TypeTableEntryIdEnum) {6030 if (expr_type->id == TypeTableEntryIdEnum) {
6031 field_use_counts = allocate<int>(expr_type->data.enumeration.field_count);6031 field_use_counts = allocate<int>(expr_type->data.enumeration.field_count);
6032 } else if (expr_type->id == TypeTableEntryIdErrorUnion) {6032 } else if (expr_type->id == TypeTableEntryIdErrorUnion) {
src/codegen.cpp+2-2
...@@ -2757,7 +2757,7 @@ static LLVMValueRef gen_if_var_expr(CodeGen *g, AstNode *node) {...@@ -2757,7 +2757,7 @@ static LLVMValueRef gen_if_var_expr(CodeGen *g, AstNode *node) {
2757static LLVMValueRef gen_block(CodeGen *g, AstNode *block_node, TypeTableEntry *implicit_return_type) {2757static LLVMValueRef gen_block(CodeGen *g, AstNode *block_node, TypeTableEntry *implicit_return_type) {
2758 assert(block_node->type == NodeTypeBlock);2758 assert(block_node->type == NodeTypeBlock);
27592759
2760 LLVMValueRef return_value;2760 LLVMValueRef return_value = nullptr;
2761 for (int i = 0; i < block_node->data.block.statements.length; i += 1) {2761 for (int i = 0; i < block_node->data.block.statements.length; i += 1) {
2762 AstNode *statement_node = block_node->data.block.statements.at(i);2762 AstNode *statement_node = block_node->data.block.statements.at(i);
2763 return_value = gen_expr(g, statement_node);2763 return_value = gen_expr(g, statement_node);
...@@ -3301,7 +3301,7 @@ static LLVMValueRef gen_var_decl_expr(CodeGen *g, AstNode *node) {...@@ -3301,7 +3301,7 @@ static LLVMValueRef gen_var_decl_expr(CodeGen *g, AstNode *node) {
3301 }3301 }
3302 }3302 }
33033303
3304 LLVMValueRef init_val;3304 LLVMValueRef init_val = nullptr;
3305 TypeTableEntry *init_val_type;3305 TypeTableEntry *init_val_type;
3306 return gen_var_decl_raw(g, node, &node->data.variable_declaration, false, &init_val, &init_val_type, false);3306 return gen_var_decl_raw(g, node, &node->data.variable_declaration, false, &init_val, &init_val_type, false);
3307}3307}
src/parseh.cpp+1-1
...@@ -1205,7 +1205,7 @@ static void visit_var_decl(Context *c, const VarDecl *var_decl) {...@@ -1205,7 +1205,7 @@ static void visit_var_decl(Context *c, const VarDecl *var_decl) {
1205 emit_warning(c, var_decl, "ignoring variable '%s' - unable to evaluate initializer\n", buf_ptr(name));1205 emit_warning(c, var_decl, "ignoring variable '%s' - unable to evaluate initializer\n", buf_ptr(name));
1206 return;1206 return;
1207 }1207 }
1208 AstNode *init_node;1208 AstNode *init_node = nullptr;
1209 switch (ap_value->getKind()) {1209 switch (ap_value->getKind()) {
1210 case APValue::Int:1210 case APValue::Int:
1211 {1211 {