ci: upgrade cppcheck to 2.10; fix / suppress reported issues (#5328)

## Issue being fixed or feature implemented
Upgraded version of cppcheck

## What was done?

## How Has This Been Tested?
Ran cppcheck

## Breaking Changes
None

## Checklist:
_Go over all the following points, and put an `x` in all the boxes that
apply._
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone _(for repository
code-owners and collaborators only)_
This commit is contained in:
PastaPastaPasta 2023-04-16 12:08:33 -05:00 committed by GitHub
parent 7a4383bda7
commit 770eefcd08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

@ -79,7 +79,7 @@ RUN apt-get update && apt-get install $APT_ARGS \
xorriso \
&& rm -rf /var/lib/apt/lists/*
ARG CPPCHECK_VERSION=2.9
ARG CPPCHECK_VERSION=2.10
RUN curl -sL "https://github.com/danmar/cppcheck/archive/${CPPCHECK_VERSION}.tar.gz" | tar -xvzf - --directory /tmp/
RUN cd /tmp/cppcheck-${CPPCHECK_VERSION} && mkdir build && cd build && cmake .. && cmake --build . -j 8
ENV PATH "/tmp/cppcheck-${CPPCHECK_VERSION}/build/bin:${PATH}"

View File

@ -771,7 +771,7 @@ bool CBLSWorker::VerifyVerificationVectors(const std::vector<BLSVerificationVect
std::set<uint256> set;
for (size_t i = 0; i < count; i++) {
auto& vvec = vvecs[start + i];
const auto& vvec = vvecs[start + i];
if (vvec == nullptr) {
return false;
}

View File

@ -33,6 +33,7 @@ IGNORED_WARNINGS=(
"src/spork.h:.* warning: struct member 'CSporkDef::defaultValue' is never used."
"src/test/dip0020opcodes_tests.cpp:.* warning: There is an unknown macro here somewhere. Configuration is required. If BOOST_FIXTURE_TEST_SUITE is a macro then please configure it."
"src/ctpl_stl.h:.*22: warning: Dereferencing '_f' after it is deallocated / released"
"src/cachemultimap.h:.*: warning: Variable 'mapIt' can be declared as reference to const"
# "src/llmq/snapshot.cpp:.*:17: warning: Consider using std::copy algorithm instead of a raw loop."
# "src/llmq/snapshot.cpp:.*:18: warning: Consider using std::copy algorithm instead of a raw loop."