Invoked against repo at: 8e62a241ae1ee4ead0144e9573b129b989c58af5 #include <pair> #include <vector> void ast() { struct S {}; std::pair<int, std::vector<S>> p; std::count_if(p.second.begin(), p.second.end(),[](decltype(p.second) v)->bool { return true; }); }
I've been setting up a custom library configuration for matching certain (C/C++) keywords. I followed the reference guide, as available here: https://cppcheck.sourceforge.io/reference-cfg-format.pdf However, although the <function> tags were explained, I could not find anything about the <warn ...> tag. I did manage to locate information in this SO post: https://stackoverflow.com/questions/53295937/how-to-configure-cppcheck-to-discourage-usage-of-a-function/53297696 ...and that achieved exactly what...
Looks like I didn't pick the correct search terms...just found this old thread: https://sourceforge.net/p/cppcheck/discussion/general/thread/08b0400c/
Some recent develoment using cmake resulted in a cutover to invoke cppcheck via the in-built CMAKE_CPPCHECK support. Having recently gone through a similar process for clang-tidy, making use of compile_commands.json, I blindly added this file via --project. However, cmake invokes cppcheck for every source file (as part of its co-compile process), passing each for a single file analysis. The version of cppcheck I was using (2.3) ignores the source file if a project file has been specified. The outcome...