AI review of 2026-10-20_22-02-38-06e5836a41bd-results.txt PR: #8720 https://github.com/cppcheck-opensource/cppcheck/pull/8720 Tested: 06e5836a41bdb02146f07f018ea83d47c6dbdeea Merge base: 99ad2a83ab14c29d753272388b916887d936af03 Reviewed: 2026-10-21 08:10:48 UTC Model: claude-opus-5-5 (effort high) Results: 10 reviewed of 21 in the report (random sample), the test is still running (200 analysed of 1000 requested packages) Verdicts: 4 improvement, 6 regression Tokens: 17937 input, 616432 cache read, 154108 cache write, 5768 output The verdicts are written by AI and can be wrong. ---- 1 / 10 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/d/darkradiant/darkradiant_3.9.0.orig.tar.gz Result: your codereader-DarkRadiant-f84caab/libs/pugixml/pugixml.cpp:4440:144: style: Parameter 'alloc' can be declared as pointer to const [constParameterPointer] Explanation: With the PR, the call `node_copy_string(dn->name, dn->header, ...)` now has its template arguments deduced from the argument types, so the template is instantiated and checked. In the body, `alloc` is only used in the null test `if (alloc && ...)`. It is never dereferenced, written through, or passed on. Its type `xml_allocator*` does not depend on the template parameters, and the callers' `xml_allocator*` arguments convert implicitly to `const xml_allocator*`. So the parameter could be a pointer to const, and the new warning is a true positive. ---- 2 / 10 ---- Verdict: REGRESSION (low confidence) Package: https://ftp.debian.org/debian/pool/main/f/firebird3.0/firebird3.0_3.0.14.ds7.orig.tar.xz Result: your Firebird-3.0.14.33856-0/extern/cloop/src/tests/test1/CppTest.cpp:408:11: style: C-style pointer casting [cstyleCast] Explanation: `createFactory` is a function pointer, `calc::IFactory* (*)()`. The new deduction does not handle function pointers. Its ValueType is most likely read as a record type with pointer levels, so `loadSymbol` gets instantiated with a data-pointer type such as `calc::IFactory*`, which is not the real `T`. That wrong instantiation turns `(T) dlsym(...)` into `(calc::IFactory *) ...`, which matches the cstyleCast pattern. With the real `T`, a cast to a function pointer type, the check would not fire, and main does not report it. Line 408 is a real C-style cast in C++, so the warning is defensible. It exists only because the instantiation is wrong, so it reflects worse understanding of the code. ---- 3 / 10 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/l/ltt-control/ltt-control_2.16.0.orig.tar.bz2 Result: your lttng-tools-2.16.0/src/vendor/fmt/format.h:3932:24: style: The member function 'fmt::v11::format_int::format_signed < int >' can be static. [functionStatic] lttng-tools-2.16.0/src/vendor/fmt/format.h:3932:24: note: The member function 'fmt::v11::format_int::format_signed < int >' can be static. lttng-tools-2.16.0/src/vendor/fmt/format.h:3932:24: note: The member function 'fmt::v11::format_int::format_signed < int >' can be static. Explanation: `format_signed` calls the member template `format_unsigned`, which writes into the non-static member `buffer_`. So `format_signed` cannot be static. The PR's new type deduction instantiates `format_signed`. Inside that instantiation, the call `format_unsigned(abs_value)` evidently is not linked to a member function: `abs_value` has the alias type `uint32_or_64_or_128_t`. The functionStatic check therefore sees no member access and wrongly reports the function as static-able. This is a new false positive. ---- 4 / 10 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/l/ltt-control/ltt-control_2.16.0.orig.tar.bz2 Result: your lttng-tools-2.16.0/src/vendor/fmt/format.h:3932:24: style: The member function 'fmt::v11::format_int::format_signed < long >' can be static. [functionStatic] lttng-tools-2.16.0/src/vendor/fmt/format.h:3932:24: note: The member function 'fmt::v11::format_int::format_signed < long >' can be static. lttng-tools-2.16.0/src/vendor/fmt/format.h:3932:24: note: The member function 'fmt::v11::format_int::format_signed < long >' can be static. Explanation: `format_signed` calls `format_unsigned(abs_value)`. `format_unsigned` is a non-static member that writes into the member array `buffer_`, so `format_signed` uses `this` and cannot be static. The PR newly instantiates `format_signed` through type deduction from the constructor calls. In the instantiated body Cppcheck apparently no longer sees the call to the member template `format_unsigned` as a member access, so it reports a false `functionStatic` warning. ---- 5 / 10 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/m/mpd/mpd_0.24.16.orig.tar.xz Result: your mpd-0.24.16/src/lib/curl/Easy.hxx:198:7: style: The member function 'CurlEasy::SetMimePost' can be static. [functionStatic] Explanation: SetMimePost calls SetOption(CURLOPT_MIMEPOST, mime). SetOption is a member template of CurlEasy that passes the 'handle' member to curl_easy_setopt, so SetMimePost cannot be static. With the PR, the new type deduction instantiates SetOption. The call to the instantiated member function is apparently no longer recognized as a call that uses 'this', so checkclass wrongly reports functionStatic. The same false positive appears for SetPrivate, SetTimeout and the other SetOption wrappers. This is a new false positive. ---- 6 / 10 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/m/mpd/mpd_0.24.16.orig.tar.xz Result: your mpd-0.24.16/src/lib/curl/Easy.hxx:80:7: style: The member function 'CurlEasy::SetPrivate' can be static. [functionStatic] Explanation: SetPrivate calls the member template SetOption(CURLOPT_PRIVATE, pointer). SetOption calls TrySetOption, which uses the member 'handle'. So SetPrivate depends on the object and cannot be static. With the PR, the call is now deduced and rewritten to SetOption. Cppcheck no longer sees it as a call to a non-static member function, so it reports a false functionStatic. The same new false positives appear for the other Set* wrappers. ---- 7 / 10 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/n/ncbi-blast+/ncbi-blast+_2.17.0+ds.orig.tar.xz Result: main ncbi-blast-2.17.0+-src/c++/src/algo/blast/dbindex/dbindex_factory.cpp:95:58: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable word_t [valueFlowBailoutIncompleteVar] Explanation: `WriteWord` is a function template whose type parameter `word_t` is used in `sizeof(word_t)`. Before the PR it was never instantiated, because its calls pass variables rather than literals. ValueFlow therefore saw the raw template body, treated `word_t` as an incomplete variable and skipped the function. The PR deduces template arguments from the types of argument expressions, so the calls now produce concrete instantiations and the uninstantiated template is removed. The bailout disappearing means Cppcheck now analyzes this code with real types instead of giving up on it. ---- 8 / 10 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/n/ncbi-blast+/ncbi-blast+_2.17.0+ds.orig.tar.xz Result: your ncbi-blast-2.17.0+-src/c++/src/util/checksum/farmhash/farmhash.cc:393:24: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable c1 [valueFlowBailoutIncompleteVar] Explanation: The PR now deduces calls such as `DebugTweak(Uint128Low64(x))` and instantiates `DebugTweak`. In that instantiation, `c1` is not resolved. It is a known `static const uint32_t` declared in the same namespace (line 366), yet it is treated as an incomplete variable, so ValueFlow skips the whole function. The likely cause is that the instantiation is appended outside the namespace block and the variable lookup does not see it. A new bailout for a variable that is clearly declared means Cppcheck understands this code worse. The removed `main` line is in an unrelated file. ---- 9 / 10 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/r/r-cran-readr/r-cran-readr_2.2.0.orig.tar.gz Result: your readr/src/QiParsers.h:354:13: style: Comparing expression of type 'signed int &' against value 2147483647. Condition is always false. [compareValueOutOfTypeRangeError] Explanation: The PR now deduces the template arguments of `parseInt(first, last, res)` from the argument variables, so `parseInt` is instantiated with `Attr = int`. In that instantiation `res` is `int&`, and `res > INT_MAX || res < INT_MIN` can never be true. The warning is correct, and it points at a real bug: the check was meant to test `lres` (the `long` result of `strtol`), not `res`. Because the check is dead, out-of-range values on 64-bit platforms are never caught by it. This is a new true positive. ---- 10 / 10 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/u/ucc/ucc_1.9.0.orig.tar.gz Result: main ucc-1.9.0/test/gtest/common/gtest-all.cc:11450:42: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable CharType [valueFlowBailoutIncompleteVar] Explanation: PrintCharsAsStringTo is only called with deduced arguments, e.g. `PrintCharsAsStringTo(begin, len - 1, os)` from UniversalPrintCharArray. Before the PR, Cppcheck only deduced template arguments from literals. The template was left uninstantiated, and ValueFlow skipped the function because `CharType` in `sizeof(CharType)` is an unknown name. The PR deduces template arguments from the argument types, including calls inside instantiated bodies in later rounds. So the function is likely now instantiated with concrete types (char/wchar_t) and the generic template is removed. The bailout disappearing therefore reflects that Cppcheck now analyzes concrete instantiations of this function.