mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
fix gcc 5.4.0compile errors
This commit is contained in:
parent
20eb749ad6
commit
4979e606c3
@ -6026,7 +6026,7 @@ static TypeTableEntry *analyze_switch_expr(CodeGen *g, ImportTableEntry *import,
|
|||||||
|
|
||||||
|
|
||||||
int *field_use_counts = nullptr;
|
int *field_use_counts = nullptr;
|
||||||
HashMap<int, AstNode *, int_hash, int_eq> err_use_nodes;
|
HashMap<int, AstNode *, int_hash, int_eq> err_use_nodes = {};
|
||||||
if (expr_type->id == TypeTableEntryIdEnum) {
|
if (expr_type->id == TypeTableEntryIdEnum) {
|
||||||
field_use_counts = allocate<int>(expr_type->data.enumeration.field_count);
|
field_use_counts = allocate<int>(expr_type->data.enumeration.field_count);
|
||||||
} else if (expr_type->id == TypeTableEntryIdErrorUnion) {
|
} else if (expr_type->id == TypeTableEntryIdErrorUnion) {
|
||||||
|
|||||||
@ -2757,7 +2757,7 @@ static LLVMValueRef gen_if_var_expr(CodeGen *g, AstNode *node) {
|
|||||||
static LLVMValueRef gen_block(CodeGen *g, AstNode *block_node, TypeTableEntry *implicit_return_type) {
|
static LLVMValueRef gen_block(CodeGen *g, AstNode *block_node, TypeTableEntry *implicit_return_type) {
|
||||||
assert(block_node->type == NodeTypeBlock);
|
assert(block_node->type == NodeTypeBlock);
|
||||||
|
|
||||||
LLVMValueRef return_value;
|
LLVMValueRef return_value = nullptr;
|
||||||
for (int i = 0; i < block_node->data.block.statements.length; i += 1) {
|
for (int i = 0; i < block_node->data.block.statements.length; i += 1) {
|
||||||
AstNode *statement_node = block_node->data.block.statements.at(i);
|
AstNode *statement_node = block_node->data.block.statements.at(i);
|
||||||
return_value = gen_expr(g, statement_node);
|
return_value = gen_expr(g, statement_node);
|
||||||
@ -3301,7 +3301,7 @@ static LLVMValueRef gen_var_decl_expr(CodeGen *g, AstNode *node) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef init_val;
|
LLVMValueRef init_val = nullptr;
|
||||||
TypeTableEntry *init_val_type;
|
TypeTableEntry *init_val_type;
|
||||||
return gen_var_decl_raw(g, node, &node->data.variable_declaration, false, &init_val, &init_val_type, false);
|
return gen_var_decl_raw(g, node, &node->data.variable_declaration, false, &init_val, &init_val_type, false);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1205,7 +1205,7 @@ static void visit_var_decl(Context *c, const VarDecl *var_decl) {
|
|||||||
emit_warning(c, var_decl, "ignoring variable '%s' - unable to evaluate initializer\n", buf_ptr(name));
|
emit_warning(c, var_decl, "ignoring variable '%s' - unable to evaluate initializer\n", buf_ptr(name));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AstNode *init_node;
|
AstNode *init_node = nullptr;
|
||||||
switch (ap_value->getKind()) {
|
switch (ap_value->getKind()) {
|
||||||
case APValue::Int:
|
case APValue::Int:
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user