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)