False positive for array index out-of-bounds when dealing with postincremented index on an array of functions, e.g. #include <iostream> #include <array> #include <functional> int main(int argc, const char * argv[]) { unsigned roiElementNumber = 0; // std::array<std::function<int(const int)>,2> fillResultFunctors={ [&](const int n) { return n;}, [&](const int n) { return 100+n; } }; constexpr std::array<int,3> a{1,2,3}; //cppcheck gives false containerOutOfBounds error for(const auto i:a) { if (roiElementNumber...
False positive for array index out-of-bounds when dealing with postincremented index on an array of functions, e.g. #include <iostream> #include <array> #include <functional> int main(int argc, const char * argv[]) { unsigned roiElementNumber = 0; // std::array<std::function<int(const int)>,2> fillResultFunctors={ [&](const int n) { return n;}, [&](const int n) { return 100+n; } }; constexpr std::array<int,3> a{1,2,3}; //cppcheck gives false containerOutOfBounds error for(const auto i:a) { if (roiElementNumber...
Environment is centos7; we habitually use gcc 11.2 compiler with c++ 17 std.
Running cppcheck 2.10 on the following code produces "Internal Error. MathLib::toLongNumber: input was not completely consumed: 2_Tesla [cppcheckError]" #include <iostream> constexpr double operator"" _Tesla ( unsigned long long b ){ return b*10000.; } int main(){ const double f=2_Tesla; std::cout<<f<<std::endl; return 0; }
Thanks, just giving a spin now. One new error I'm seeing is "cppcheckError" which I guess is internal, as a result of using user-defined suffices, it seems. : "cppcheckError error Internal Error. MathLib::toLongNumber: input was not completely consumed: 1_GeV"
Thanks, just giving a spin now. One new error I'm seeing is "cppcheckError" which I guess is internal, as a result of using user-defined suffices, it seems. : "cppcheckError error Internal Error. MathLib::toLongNumber: input was not completely consumed: 1_GeV" link: http://sroe.web.cern.ch/sroe/cppcheck2021/43.html
Thanks, just giving a spin now. One new error I'm seeing is "cppcheckError" which I guess is internal, as a result of using user-defined suffices, it seems. : "cppcheckError error Internal Error. MathLib::toLongNumber: input was not completely consumed: 1_GeV"
I promised to come back with timings. Note that I am using the unpatched v2.5. The time to completion can go down to 40minutes with the --cppcheck-build-dir option. Its clear from looking at the spawned processes with 'ps' that there is one child process taking much longer than the others (I guess some particular file is difficult to digest)
My next scans are due 4 August and 6 August; I'll report the timings after.
Hi, I'm running cppcheck 2.5 on a ~4 million line codebase (on CentOS 7.9), using the following command: nohup ./cppcheck-2.5/build/bin/cppcheck -j32 --std=c++17 --enable=warning,performance,portability --inline-suppr -D__CPPCHECK__ -DATOMIC_POINTER_LOCK_FREE=2 --suppress-xml=suppressions.xml -itest/ --library=Athena.xml --xml-version=2 ./athena 2>results.xml & The processor has 16 cores, 30GB ram. The analysis proceeds really quickly up until the last few percent: 97% completion is reached after...
Hi, I'm running cppcheck 2.5 on a ~4 million line codebase (on CentOS 7.9), using the following command: nohup ./cppcheck-2.5/build/bin/cppcheck -j32 --std=c++17 --enable=warning,performance,portability --inline-suppr -D__CPPCHECK__ -DATOMIC_POINTER_LOCK_FREE=2 --suppress-xml=suppressions.xml -itest/ --library=Athena.xml --xml-version=2 ./athena 2>results.xml & The processor has 16 cores, 30GB ram. The analysis proceeds really quickly up until the last few percent: 97% completion is reached after...
Hi, I had to do the same with version 1.74...(also: had to #include <limits> in valueflow.cpp)....
Hi, I'm trying to suppress (using an error supression file), all errors in files...
Hi, I'm trying to suppress (using an error supression file), all errors in files...