Fix/update latest cppcheck issues
This commit is contained in:
parent
e212ea1a1c
commit
5240790480
|
|
@ -4,4 +4,4 @@ nullPointerOutOfMemory:cadpli.c:53
|
|||
nullPointerOutOfMemory:cadpli.c:54
|
||||
|
||||
// Unused function
|
||||
unusedFunction:ivl_dlfcn.h:73
|
||||
unusedFunction:ivl_dlfcn.h:87
|
||||
|
|
|
|||
29
cppcheck.sup
29
cppcheck.sup
|
|
@ -10,13 +10,14 @@ nullPointerOutOfMemory
|
|||
ctuuninitvar:parse_misc.cc:61
|
||||
|
||||
// Skip strdup() not constant.
|
||||
constVariablePointer:main.cc:400
|
||||
constVariablePointer:main.cc:404
|
||||
constVariablePointer:main.cc:654
|
||||
constVariablePointer:main.cc:415
|
||||
constVariablePointer:main.cc:419
|
||||
constVariablePointer:main.cc:669
|
||||
|
||||
// const auto should be const
|
||||
constVariablePointer:elab_expr.cc:344
|
||||
constVariablePointer:elab_expr.cc:413
|
||||
constVariablePointer:elab_expr.cc:347
|
||||
constVariablePointer:elab_expr.cc:416
|
||||
|
||||
// The reference cannot be const since it is updated in the calling function.
|
||||
constParameterReference:net_udp.cc:37
|
||||
|
|
@ -31,26 +32,27 @@ functionStatic:net_link.cc:193
|
|||
functionStatic:libmisc/StringHeap.cc
|
||||
|
||||
// Skip not initialized in the constructor for target scope
|
||||
uninitMemberVar:t-dll.cc:41
|
||||
uninitMemberVar:t-dll.cc:109
|
||||
|
||||
// By convention we put statics at the top scope.
|
||||
variableScope:pform.cc:3461
|
||||
|
||||
// These are correct and are used to find the base (zero) pin.
|
||||
thisSubtraction:netlist.h:5309
|
||||
thisSubtraction:netlist.h:5318
|
||||
thisSubtraction:netlist.h:5310
|
||||
thisSubtraction:netlist.h:5319
|
||||
|
||||
// This is used when running a debugger
|
||||
// debugger_release
|
||||
knownConditionTrueFalse:main.cc:931
|
||||
knownConditionTrueFalse:main.cc:949
|
||||
|
||||
// These should be checked, but are not real issues
|
||||
knownConditionTrueFalse:elaborate.cc:7621
|
||||
knownConditionTrueFalse:elaborate.cc:7633
|
||||
knownConditionTrueFalse:elab_sig.cc:271
|
||||
knownConditionTrueFalse:elab_sig.cc:338
|
||||
|
||||
// Yes, it's a duplicate
|
||||
duplicateCondition:elaborate.cc:7672
|
||||
duplicateCondition:elaborate.cc:7684
|
||||
|
||||
// To complicated to use std::find_if()
|
||||
useStlAlgorithm:map_named_args.cc:38
|
||||
|
|
@ -59,7 +61,7 @@ useStlAlgorithm:map_named_args.cc:38
|
|||
derefInvalidIterator:netmisc.cc:420
|
||||
|
||||
// By convention we put statics at the top scope.
|
||||
variableScope:t-dll.cc:2377
|
||||
variableScope:t-dll.cc:2309
|
||||
|
||||
// We check memory allocation with valgrind
|
||||
unsafeClassCanLeak:libmisc/StringHeap.h:79
|
||||
|
|
@ -720,7 +722,7 @@ unusedFunction:Statement.h:192
|
|||
// chain_args()
|
||||
unusedFunction:Statement.h:341
|
||||
// gn_modules_nest()
|
||||
unusedFunction:compiler.h:228
|
||||
unusedFunction:compiler.h:245
|
||||
// driven_mask()
|
||||
unusedFunction:link_const.cc:275
|
||||
// find_root_scope()
|
||||
|
|
@ -732,7 +734,7 @@ unusedFunction:net_link.cc:689
|
|||
// get_def_fileline()
|
||||
unusedFunction:net_scope.cc:201
|
||||
// get_module_port_info()
|
||||
unusedFunction:net_scope.cc:591
|
||||
unusedFunction:net_scope.cc:599
|
||||
// find_link_signal()
|
||||
unusedFunction:netlist.cc:111
|
||||
// find_link()
|
||||
|
|
@ -756,13 +758,14 @@ unusedFunction:t-dll-expr.cc:55
|
|||
// mul_expr_by_const_()
|
||||
unusedFunction:t-dll-expr.cc:91
|
||||
// net_assign()
|
||||
unusedFunction:t-dll.cc:2368
|
||||
unusedFunction:t-dll.cc:2300
|
||||
// is_before()
|
||||
unusedFunction:verinum.cc:588
|
||||
|
||||
// Errors/limitations in the generated yacc and lex files
|
||||
constVariablePointer:<stdout>
|
||||
cstyleCast:<stdout>
|
||||
duplicateBreak:<stdout>
|
||||
nullPointer:<stdout>
|
||||
redundantInitialization:<stdout>
|
||||
syntaxError:<stdout>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
// cppcheck is wrong this is correct usage
|
||||
syntaxError:main.c:405
|
||||
syntaxError:main.c:408
|
||||
syntaxError:main.c:410
|
||||
syntaxError:main.c:413
|
||||
|
||||
// cppcheck is missing the code adds a \0 at the previous location.
|
||||
knownConditionTrueFalse:main.c:1086
|
||||
redundantAssignment:main.c:1085
|
||||
knownConditionTrueFalse:main.c:1123
|
||||
redundantAssignment:main.c:1122
|
||||
|
||||
// Skip all memory issues since they should be handled by ivl_alloc.h
|
||||
memleakOnRealloc
|
||||
|
|
@ -21,6 +21,7 @@ constVariablePointer:cfparse.c
|
|||
knownConditionTrueFalse:cfparse.c
|
||||
sizeofwithnumericparameter:cfparse.c
|
||||
constVariablePointer:<stdout>
|
||||
duplicateBreak:<stdout>
|
||||
nullPointer:<stdout>
|
||||
redundantInitialization:<stdout>
|
||||
staticFunction:<stdout>
|
||||
|
|
|
|||
|
|
@ -344,7 +344,7 @@ NetExpr* PEAssignPattern::elaborate_expr_uarray_(Design *des, NetScope *scope,
|
|||
if (const auto ap = dynamic_cast<PEAssignPattern*>(parms_[idx])) {
|
||||
expr = ap->elaborate_expr_uarray_(des, scope, uarray_type,
|
||||
dims, cur_dim, need_const);
|
||||
} else if (auto s = dynamic_cast<PEString*>(parms_[idx])) {
|
||||
} else if (const auto s = dynamic_cast<PEString*>(parms_[idx])) {
|
||||
expr = s->elaborate_expr_uarray_(des, scope, uarray_type,
|
||||
dims, cur_dim);
|
||||
} else if (dynamic_cast<PEConcat*>(parms_[idx])) {
|
||||
|
|
|
|||
|
|
@ -1692,7 +1692,6 @@ static void expand_using_args(void)
|
|||
char* head;
|
||||
char* tail;
|
||||
char* dest;
|
||||
int arg;
|
||||
int length;
|
||||
|
||||
if (def_argc > cur_macro->argc) {
|
||||
|
|
@ -1721,7 +1720,7 @@ static void expand_using_args(void)
|
|||
if (*tail != ARG_MARK) {
|
||||
tail++;
|
||||
} else {
|
||||
arg = tail[1]; assert(arg < def_argc);
|
||||
int arg = tail[1]; assert(arg < def_argc);
|
||||
|
||||
const char*use_argv;
|
||||
int use_argl;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2012-2025 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2012-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
|
||||
|
|
@ -525,7 +525,7 @@ bool NetBlock::evaluate_function(const LineInfo&loc,
|
|||
map<perm_string,LocalVar>&use_context_map = use_local_context_map? local_context_map : context_map;
|
||||
|
||||
bool flag = true;
|
||||
NetProc*cur = last_;
|
||||
const NetProc*cur = last_;
|
||||
do {
|
||||
cur = cur->next_;
|
||||
if (debug_eval_tree) {
|
||||
|
|
|
|||
|
|
@ -360,7 +360,7 @@ bool NetAssignBase::synth_async(Design*des, NetScope*scope,
|
|||
return false;
|
||||
}
|
||||
|
||||
NetNet*lsig = lval_->sig();
|
||||
const NetNet*lsig = lval_->sig();
|
||||
if (!lsig) {
|
||||
cerr << get_fileline() << ": error: "
|
||||
"NetAssignBase::synth_async on unsupported lval ";
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ constParameterPointer:fp.cc
|
|||
knownConditionTrueFalse:fp.cc
|
||||
constVariablePointer:fp_lex.cc
|
||||
cstyleCast:fp_lex.cc
|
||||
duplicateBreak:fp_lex.cc
|
||||
nullPointer:fp_lex.cc
|
||||
redundantInitialization:fp_lex.cc
|
||||
unusedFunction:fp_lex.cc
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2001-2025 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2001-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
|
||||
|
|
@ -912,7 +912,7 @@ static void draw_equiv_impl_in_scope(ivl_net_logic_t lptr)
|
|||
unsigned ninp;
|
||||
const char *lval;
|
||||
const char *rval;
|
||||
const char*ltype = "?";
|
||||
const char *ltype;
|
||||
|
||||
assert(width_of_nexus(ivl_logic_pin(lptr, 0)) == 1);
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,6 @@ constParameterPointer:fstapi.c
|
|||
constVariablePointer:fstapi.c
|
||||
duplicateConditionalAssign:fstapi.c
|
||||
knownConditionTrueFalse:fstapi.c
|
||||
memleak:fstapi.c
|
||||
missingInclude:fst_win_unistd.h:50
|
||||
nullPointer:fstapi.c
|
||||
shiftTooManyBits:fstapi.c
|
||||
|
|
@ -75,85 +74,85 @@ uselessAssignmentPtrArg:fstapi.c
|
|||
variableScope:fstapi.c
|
||||
// These functions are not used by Icarus
|
||||
// fstReaderClrFacProcessMask()
|
||||
unusedFunction:fstapi.c:3513
|
||||
unusedFunction:fstapi.c:3514
|
||||
// fstReaderClrFacProcessMaskAll()
|
||||
unusedFunction:fstapi.c:3533
|
||||
unusedFunction:fstapi.c:3534
|
||||
// fstReaderGetAliasCount()
|
||||
unusedFunction:fstapi.c:3578
|
||||
unusedFunction:fstapi.c:3579
|
||||
// fstReaderGetCurrentFlatScope()
|
||||
unusedFunction:fstapi.c:3392
|
||||
unusedFunction:fstapi.c:3393
|
||||
// fstReaderGetCurrentScopeLen()
|
||||
unusedFunction:fstapi.c:3465
|
||||
unusedFunction:fstapi.c:3466
|
||||
// fstReaderGetCurrentScopeUserInfo()
|
||||
unusedFunction:fstapi.c:3401
|
||||
unusedFunction:fstapi.c:3402
|
||||
// fstReaderGetDateString()
|
||||
unusedFunction:fstapi.c:3598
|
||||
unusedFunction:fstapi.c:3599
|
||||
// fstReaderGetDoubleEndianMatchState()
|
||||
unusedFunction:fstapi.c:3588
|
||||
unusedFunction:fstapi.c:3589
|
||||
// fstReaderGetDumpActivityChangeTime()
|
||||
unusedFunction:fstapi.c:3618
|
||||
unusedFunction:fstapi.c:3619
|
||||
// fstReaderGetDumpActivityChangeValue()
|
||||
unusedFunction:fstapi.c:3627
|
||||
unusedFunction:fstapi.c:3628
|
||||
// fstReaderGetEndTime()
|
||||
unusedFunction:fstapi.c:3553
|
||||
unusedFunction:fstapi.c:3554
|
||||
// fstReaderGetFacProcessMask()
|
||||
unusedFunction:fstapi.c:3486
|
||||
unusedFunction:fstapi.c:3487
|
||||
// fstReaderGetFileType()
|
||||
unusedFunction:fstapi.c:3603
|
||||
unusedFunction:fstapi.c:3604
|
||||
// fstReaderGetFseekFailed()
|
||||
unusedFunction:fstapi.c:3474
|
||||
unusedFunction:fstapi.c:3475
|
||||
// fstReaderGetMaxHandle()
|
||||
unusedFunction:fstapi.c:3573
|
||||
unusedFunction:fstapi.c:3574
|
||||
// fstReaderGetMemoryUsedByWriter()
|
||||
unusedFunction:fstapi.c:3558
|
||||
unusedFunction:fstapi.c:3559
|
||||
// fstReaderGetNumberDumpActivityChanges()
|
||||
unusedFunction:fstapi.c:3613
|
||||
unusedFunction:fstapi.c:3614
|
||||
// fstReaderGetScopeCount()
|
||||
unusedFunction:fstapi.c:3563
|
||||
unusedFunction:fstapi.c:3564
|
||||
// fstReaderGetStartTime()
|
||||
unusedFunction:fstapi.c:3548
|
||||
unusedFunction:fstapi.c:3549
|
||||
// fstReaderGetTimescale()
|
||||
unusedFunction:fstapi.c:3543
|
||||
unusedFunction:fstapi.c:3544
|
||||
// fstReaderGetTimezero()
|
||||
unusedFunction:fstapi.c:3608
|
||||
unusedFunction:fstapi.c:3609
|
||||
// fstReaderGetValueChangeSectionCount()
|
||||
unusedFunction:fstapi.c:3583
|
||||
unusedFunction:fstapi.c:3584
|
||||
// fstReaderGetValueFromHandleAtTime()
|
||||
unusedFunction:fstapi.c:5952
|
||||
unusedFunction:fstapi.c:5953
|
||||
// fstReaderGetVarCount()
|
||||
unusedFunction:fstapi.c:3568
|
||||
unusedFunction:fstapi.c:3569
|
||||
// fstReaderGetVersionString()
|
||||
unusedFunction:fstapi.c:3593
|
||||
unusedFunction:fstapi.c:3594
|
||||
// fstReaderIterBlocks()
|
||||
unusedFunction:fstapi.c:4832
|
||||
unusedFunction:fstapi.c:4833
|
||||
// fstReaderIterBlocksSetNativeDoublesOnCallback()
|
||||
unusedFunction:fstapi.c:3659
|
||||
unusedFunction:fstapi.c:3660
|
||||
// fstReaderIterateHier()
|
||||
unusedFunction:fstapi.c:3872
|
||||
unusedFunction:fstapi.c:3873
|
||||
// fstReaderIterateHierRewind()
|
||||
unusedFunction:fstapi.c:3856
|
||||
unusedFunction:fstapi.c:3857
|
||||
// fstReaderOpen()
|
||||
unusedFunction:fstapi.c:4728
|
||||
unusedFunction:fstapi.c:4729
|
||||
// fstReaderOpenForUtilitiesOnly()
|
||||
unusedFunction:fstapi.c:4721
|
||||
unusedFunction:fstapi.c:4722
|
||||
// fstReaderPushScope()
|
||||
unusedFunction:fstapi.c:3435
|
||||
unusedFunction:fstapi.c:3436
|
||||
// fstReaderResetScope()
|
||||
unusedFunction:fstapi.c:3427
|
||||
unusedFunction:fstapi.c:3428
|
||||
// fstReaderSetFacProcessMask()
|
||||
unusedFunction:fstapi.c:3500
|
||||
unusedFunction:fstapi.c:3501
|
||||
// fstReaderSetFacProcessMaskAll()
|
||||
unusedFunction:fstapi.c:3526
|
||||
unusedFunction:fstapi.c:3527
|
||||
// fstReaderSetLimitTimeRange()
|
||||
unusedFunction:fstapi.c:3636
|
||||
unusedFunction:fstapi.c:3637
|
||||
// fstReaderSetUnlimitedTimeRange()
|
||||
unusedFunction:fstapi.c:3645
|
||||
unusedFunction:fstapi.c:3646
|
||||
// fstReaderSetVcdExtensions()
|
||||
unusedFunction:fstapi.c:3652
|
||||
unusedFunction:fstapi.c:3653
|
||||
// fstUtilityExtractEnumTableFromString()
|
||||
unusedFunction:fstapi.c:6930
|
||||
unusedFunction:fstapi.c:6931
|
||||
// fstUtilityFreeEnumTable()
|
||||
unusedFunction:fstapi.c:6995
|
||||
unusedFunction:fstapi.c:6996
|
||||
// fstWriterCreateEnumTable()
|
||||
unusedFunction:fstapi.c:2715
|
||||
// fstWriterCreateVar2()
|
||||
|
|
|
|||
|
|
@ -838,7 +838,7 @@ static unsigned int get_format_char(char **rtn, int ljust, int plus,
|
|||
vpi_printf("WARNING: %s:%d: incompatible value for %s%s.\n",
|
||||
info->filename, info->lineno, info->name, fmtb);
|
||||
} else {
|
||||
PLI_INT32 veclen, word, elem, bits, byte;
|
||||
PLI_INT32 veclen, word, elem, byte;
|
||||
char *cp;
|
||||
|
||||
veclen = (vpi_get(vpiSize, info->items[*idx])+31)/32;
|
||||
|
|
@ -849,7 +849,7 @@ static unsigned int get_format_char(char **rtn, int ljust, int plus,
|
|||
for (word = 0; word < veclen; word += 1) {
|
||||
/* Write the aval followed by the bval in endian order. */
|
||||
for (elem = 0; elem < 2; elem += 1) {
|
||||
bits = *(&value.value.vector[word].aval+elem);
|
||||
PLI_INT32 bits = *(&value.value.vector[word].aval+elem);
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
for (byte = 3; byte >= 0; byte -= 1) {
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ useInitializationList:delay.cc:513
|
|||
constParameterPointer:vpi_priv.cc:1458
|
||||
|
||||
// Operator new/delete are static so cannot override
|
||||
duplInheritedMember:vvp_net.h:1476
|
||||
duplInheritedMember:vvp_net.h:1477
|
||||
duplInheritedMember:vvp_net.h:1481
|
||||
duplInheritedMember:vvp_net.h:1482
|
||||
duplInheritedMember:vvp_net_sig.h:187
|
||||
duplInheritedMember:vvp_net_sig.h:188
|
||||
duplInheritedMember:vvp_net_sig.h:253
|
||||
|
|
@ -154,10 +154,10 @@ redundantAssignment:vpi_modules.cc:117
|
|||
invalidScanfArgType_int:compile.cc:597
|
||||
invalidScanfArgType_int:compile.cc:603
|
||||
invalidScanfArgType_int:compile.cc:609
|
||||
invalidScanfArgType_int:vthread.cc:4545
|
||||
invalidScanfArgType_int:vthread.cc:4548
|
||||
invalidScanfArgType_int:vthread.cc:4551
|
||||
invalidScanfArgType_int:vthread.cc:4554
|
||||
invalidScanfArgType_int:vthread.cc:4541
|
||||
invalidScanfArgType_int:vthread.cc:4544
|
||||
invalidScanfArgType_int:vthread.cc:4547
|
||||
invalidScanfArgType_int:vthread.cc:4550
|
||||
|
||||
// The new() operator is always used to allocate space for this class and
|
||||
// pool is defined there.
|
||||
|
|
@ -227,14 +227,15 @@ unusedFunction:vvp_net.cc:1752
|
|||
// as_string()
|
||||
unusedFunction:vvp_net.cc:1855
|
||||
// fully_featured_resolv_()
|
||||
unusedFunction:vvp_net.cc:3581
|
||||
unusedFunction:vvp_net.cc:3704
|
||||
// words()
|
||||
unusedFunction:vvp_net.h:595
|
||||
unusedFunction:vvp_net.h:600
|
||||
// force_vec8()
|
||||
unusedFunction:vvp_net_sig.cc:128
|
||||
|
||||
// Unused functions from the lexor
|
||||
duplicateBreak:lexor.lex
|
||||
duplicateBreak:lexor.cc
|
||||
unusedStructMember:lexor.lex
|
||||
constVariablePointer:lexor.cc
|
||||
cstyleCast:lexor.cc
|
||||
|
|
|
|||
|
|
@ -6139,7 +6139,7 @@ bool of_STORE_STRA(vthread_t thr, vvp_code_t cp)
|
|||
bool of_STORE_VEC4(vthread_t thr, vvp_code_t cp)
|
||||
{
|
||||
vvp_net_ptr_t ptr(cp->net, 0);
|
||||
vvp_signal_value*sig = dynamic_cast<vvp_signal_value*> (cp->net->fil);
|
||||
const vvp_signal_value*sig = dynamic_cast<vvp_signal_value*> (cp->net->fil);
|
||||
unsigned off_index = cp->bit_idx[0];
|
||||
unsigned int wid = cp->bit_idx[1];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue