From: Larry Doolittle Date: Fri, 14 Aug 2015 20:22:17 +0000 (-0700) Subject: Keep gcc from complaining about uninitialized variables X-Git-Tag: yosys-0.6~195 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=022f570563d8b067e9638bc91bbd168f4c5cb817;p=yosys.git Keep gcc from complaining about uninitialized variables --- diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index cc9bbd237..5eb173c9a 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -2102,9 +2102,9 @@ AstNode *AstNode::readmem(bool is_readmemh, std::string mem_filename, AstNode *m AstNode *block = new AstNode(AST_BLOCK); AstNode *meminit = nullptr; - int next_meminit_cursor; + int next_meminit_cursor=0; vector meminit_bits; - int meminit_size; + int meminit_size=0; std::ifstream f; f.open(mem_filename.c_str()); diff --git a/passes/memory/memory_unpack.cc b/passes/memory/memory_unpack.cc index 07ec4564c..a497362bf 100644 --- a/passes/memory/memory_unpack.cc +++ b/passes/memory/memory_unpack.cc @@ -79,7 +79,7 @@ void handle_memory(RTLIL::Module *module, RTLIL::Cell *memory) Const initval = memory->parameters.at("\\INIT"); RTLIL::Cell *last_init_cell = nullptr; SigSpec last_init_data; - int last_init_addr; + int last_init_addr=0; for (int i = 0; i < GetSize(initval) && i/mem->width < (1 << abits); i += mem->width) { Const val = initval.extract(i, mem->width, State::Sx);