From 1b3e321d350207ddf18df32871672ed9a4fdf3d2 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Mon, 4 May 2015 22:32:29 +0100 Subject: [PATCH] Eliminate a few new compiler warnings. --- net_scope.cc | 2 ++ synth2.cc | 2 +- tgt-stub/stub.c | 2 +- tgt-vlog95/stmt.c | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/net_scope.cc b/net_scope.cc index e651b067a..5ebd657d6 100644 --- a/net_scope.cc +++ b/net_scope.cc @@ -374,6 +374,8 @@ NetScope::param_ref_t NetScope::find_parameter(perm_string key) // To get here the parameter must already exist, so we should // never get here. assert(0); + // But return something to avoid a compiler warning. + return idx; } NetScope::TYPE NetScope::type() const diff --git a/synth2.cc b/synth2.cc index 96c8208e6..e0a964f04 100644 --- a/synth2.cc +++ b/synth2.cc @@ -772,7 +772,7 @@ bool NetCase::synth_async_casez_(Design*des, NetScope*scope, netvector_t*condit_type = new netvector_t(IVL_VT_LOGIC, 0, 0); - NetCaseCmp::kind_t case_kind; + NetCaseCmp::kind_t case_kind = NetCaseCmp::EEQ; switch (type()) { case NetCase::EQ: case_kind = NetCaseCmp::EEQ; diff --git a/tgt-stub/stub.c b/tgt-stub/stub.c index 358b2efa6..451da0441 100644 --- a/tgt-stub/stub.c +++ b/tgt-stub/stub.c @@ -380,7 +380,7 @@ static void show_lpm_divide(ivl_lpm_t net) */ static void show_lpm_cmp_eeq(ivl_lpm_t net) { - const char*str; + const char*str = 0; switch (ivl_lpm_type(net)) { case IVL_LPM_CMP_EEQ: str = "EEQ"; diff --git a/tgt-vlog95/stmt.c b/tgt-vlog95/stmt.c index a804b884e..4fc67135f 100644 --- a/tgt-vlog95/stmt.c +++ b/tgt-vlog95/stmt.c @@ -942,7 +942,7 @@ static void emit_stmt_block_named(ivl_scope_t scope, ivl_statement_t stmt) static void emit_stmt_case(ivl_scope_t scope, ivl_statement_t stmt) { - const char *case_type; + const char *case_type = 0; unsigned idx, default_case, count = ivl_stmt_case_count(stmt); switch (ivl_statement_type(stmt)) { case IVL_ST_CASE: