From f0719577365955aefd36154d8dd4dc481f483541 Mon Sep 17 00:00:00 2001 From: Cary R Date: Sun, 8 Feb 2026 22:40:14 -0800 Subject: [PATCH] New cppcheck cleanup --- cppcheck.sup | 2 +- elab_sig.cc | 16 +++++++++------- t-dll-proc.cc | 4 ++-- vvp/cppcheck.sup | 4 ++-- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/cppcheck.sup b/cppcheck.sup index 964705c9c..ad756c123 100644 --- a/cppcheck.sup +++ b/cppcheck.sup @@ -31,7 +31,7 @@ functionStatic:net_link.cc:193 functionStatic:libmisc/StringHeap.cc // Skip not initialized in the constructor for target scope -uninitMemberVar:t-dll.cc +uninitMemberVar:t-dll.cc:109 // By convention we put statics at the top scope. variableScope:pform.cc:3461 diff --git a/elab_sig.cc b/elab_sig.cc index 734d0dfdd..5b8ed476b 100644 --- a/elab_sig.cc +++ b/elab_sig.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2025 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2026 Stephen Williams (steve@icarus.com) * Copyright CERN 2012 / Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it @@ -528,7 +528,7 @@ bool PGenerate::elaborate_sig(Design*des, NetScope*container) const cerr << get_fileline() << ": debug: Elaborate nets in " << "scope " << scope_path(*cur) << " in generate " << id_number << endl; - flag = elaborate_sig_(des, *cur) && flag; + flag &= elaborate_sig_(des, *cur) && flag; } return flag; @@ -574,6 +574,7 @@ bool PGenerate::elaborate_sig_(Design*des, NetScope*scope) const { // Scan the declared PWires to elaborate the obvious signals // in the current scope. + bool flag = true; typedef map::const_iterator wires_it_t; for (wires_it_t wt = wires.begin() ; wt != wires.end() ; ++ wt ) { @@ -584,7 +585,8 @@ bool PGenerate::elaborate_sig_(Design*des, NetScope*scope) const cerr << get_fileline() << ": debug: Elaborate PWire " << cur->basename() << " in scope " << scope_path(scope) << endl; - cur->elaborate_sig(des, scope); + const NetNet* res = cur->elaborate_sig(des, scope); + flag &= (res != nullptr); } elaborate_sig_funcs(des, scope, funcs); @@ -593,23 +595,23 @@ bool PGenerate::elaborate_sig_(Design*des, NetScope*scope) const typedef list::const_iterator generate_it_t; for (generate_it_t cur = generate_schemes.begin() ; cur != generate_schemes.end() ; ++ cur ) { - (*cur) -> elaborate_sig(des, scope); + flag &= (*cur)->elaborate_sig(des, scope); } typedef list::const_iterator pgate_list_it_t; for (pgate_list_it_t cur = gates.begin() ; cur != gates.end() ; ++ cur ) { - (*cur) ->elaborate_sig(des, scope); + flag &= (*cur)->elaborate_sig(des, scope); } typedef list::const_iterator proc_it_t; for (proc_it_t cur = behaviors.begin() ; cur != behaviors.end() ; ++ cur ) { - (*cur) -> statement() -> elaborate_sig(des, scope); + (*cur)->statement()->elaborate_sig(des, scope); } - return true; + return flag; } diff --git a/t-dll-proc.cc b/t-dll-proc.cc index e1fae81e4..671514a6f 100644 --- a/t-dll-proc.cc +++ b/t-dll-proc.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2025 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2026 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -185,7 +185,7 @@ bool dll_target::make_single_lval_(const LineInfo*li, struct ivl_lval_s*cur, con const NetAssign_*asn_nest = asn->nest(); ivl_assert(*li, asn_nest); struct ivl_lval_s*cur_nest = new struct ivl_lval_s; - make_single_lval_(li, cur_nest, asn_nest); + flag &= make_single_lval_(li, cur_nest, asn_nest); cur->type_ = IVL_LVAL_LVAL; cur->n.nest = cur_nest; diff --git a/vvp/cppcheck.sup b/vvp/cppcheck.sup index c78173dc6..6f87b3b63 100644 --- a/vvp/cppcheck.sup +++ b/vvp/cppcheck.sup @@ -22,7 +22,7 @@ invalidPointerCast:class_type.cc:338 invalidPointerCast:class_type.cc:339 cstyleCast:ufunc.cc:80 cstyleCast:vpi_priv.cc:229 -cstyleCast:vpi_scope.cc:615 +cstyleCast:vpi_scope.cc:603 // Skip the sscanf() field width limit warning invalidscanf:compile.cc:597 @@ -123,7 +123,7 @@ uninitMemberVar:vpi_event.cc:28 // Iterator values are set after creation uninitMemberVar:vpi_iter.cc:41 // Scope values are set after creation -uninitMemberVar:vpi_scope.cc:353 +uninitMemberVar:vpi_scope.cc:341 // The real var values are set after creation uninitMemberVar:vpi_real.cc:158 // The PV values are set after creation