AI review of 2026-11-24_21-34-53-c31f6ea0c401-results.txt PR: #8720 https://github.com/cppcheck-opensource/cppcheck/pull/8720 Tested: c31f6ea0c401c5c929e1e25ec13d7e07894ef4b2 Merge base: 4ccfcc6ff3df225b62a02318b2f34a722b1beecc Reviewed: 2026-11-27 01:41:57 UTC Model: claude-opus-5-5 (effort high) Results: 50 reviewed of 359 in the report (random sample) Verdicts: 26 improvement, 3 neutral, 21 regression Tokens: 124245 input, 3868256 cache read, 78944 cache write, 37245 output The verdicts are written by AI and can be wrong. ---- 1 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/a/amule/amule_3.2.0.orig.tar.xz Result: your amule-org-amule-8d1d7a5/src/webapi/HttpServer.cpp:1527:1: debug: SymbolDatabase couldn't resolve all user defined types. [debug] Explanation: The PR adds a new 'SymbolDatabase couldn't resolve all user defined types' debug message at the out-of-class definition 'struct CHttpServer::Impl'. The source did not change, and main resolved these types without the message. The likely cause is the PR's new template deduction rounds with incremental or full symbol database updates. These remove and recreate scopes and types and reset type pointers, which leaves some type tokens unresolved. A new debug message caused by the PR's internal changes means Cppcheck now understands the code worse. ---- 2 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/c/coin3/coin3_4.0.7+ds.orig.tar.xz Result: your coin-4.0.7/src/shapenodes/SoQuadMesh.cpp:451:11: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] Explanation: Line 451 is a `SEND_VERTEX(start + curridx)` macro call inside Coin's templated quad-mesh render function. The template is parameterized on `NormalBinding`, `MaterialBinding`, etc. The macro casts an `SbVec3f*`/`SbVec4f*` vertex pointer to `const GLfloat*` and passes it to `glVertex*fv`, a common, intentional reinterpretation of a vector of floats. Main did not report this cast. The same PR also adds `varid0` debug messages and `valueFlowBailoutIncompleteVar` messages about `NormalBinding` in sibling files. This suggests the PR now keeps and analyses the generic, uninstantiated template body (its deferred-removal / remaining-calls logic), where template parameters are unresolved names. The new warnings therefore come from Cppcheck understanding the code worse, not from new insight into a real bug. The added `dangerousTypeCast` warnings at 439/451 and the other lines are side effects of checking generic template code, so this looks like a regression. ---- 3 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/c/coin3/coin3_4.0.7+ds.orig.tar.xz Result: your coin-4.0.7/src/shapenodes/SoQuadMesh.cpp:597:22: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] Explanation: In Coin's SoQuadMesh GLRender template, `tb` is a `const SoTextureCoordinateBundle *`. The cast `(SoTextureCoordinateBundle*)tb` only removes const; it does not convert to a different class. dangerousTypeCast is meant for casts between different types, and main did not report it here. The new warning, together with the new varid0 and incomplete-variable debug messages in sibling files, suggests the PR's template and symbol-database changes left wrong or missing type information (e.g. the typeScope) on these tokens. A const-only cast is not a potentially invalid type conversion, so this is a new false positive. ---- 4 / 50 ---- Verdict: IMPROVEMENT (low confidence) Package: https://ftp.debian.org/debian/pool/main/d/dosbox-x/dosbox-x_2026.10.01+dfsg.orig.tar.xz Result: main joncampbell123-dosbox-x-b6abbd5/src/gui/sdl_gui.cpp:874:64: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable border_top [valueFlowBailoutIncompleteVar] Explanation: `border_top` at line 874 is used inside the `ShowOptions` constructor. It is most likely an inherited member of `MessageBox2`'s base window classes in the GUI toolkit (likely `BorderedWindow`), so it is a real variable, not an unknown one. Main's "incomplete variable" bailout made ValueFlow skip the whole function. The PR rebuilds and updates the symbol database after template deduction and moves the incomplete-variable pass into `finalize()`. That appears to let Cppcheck resolve `border_top`, so the bailout disappears and the function is analysed again. The exact cause cannot be confirmed from the shown context, hence low confidence. ---- 5 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/d/dosbox-x/dosbox-x_2026.10.01+dfsg.orig.tar.xz Result: your joncampbell123-dosbox-x-b6abbd5/experiments/iconv/iconvpp.hpp:272:32: style: Condition 'wchar_encoding==NULL' is always true [knownConditionTrueFalse] joncampbell123-dosbox-x-b6abbd5/experiments/iconv/iconvpp.hpp:271:67: note: Calling function '_get_wchar_encoding < char >' returns 0 joncampbell123-dosbox-x-b6abbd5/experiments/iconv/iconvpp.hpp:271:67: note: Assignment 'wchar_encoding=_get_wchar_encoding < char >()', assigned value is 0 joncampbell123-dosbox-x-b6abbd5/experiments/iconv/iconvpp.hpp:272:32: note: Condition 'wchar_encoding==NULL' is always true Explanation: `_get_wchar_encoding()` returns NULL only when `sizeof(W)` is neither 2 nor 4, so whether `wchar_encoding == NULL` holds depends on the template argument. The new warning comes from the `_Iconv` instantiation. There the enclosing condition `sizeof(dstT)==sizeof(char) && sizeof(srcT) > sizeof(char)` is false, so line 272 never runs for that instantiation. For the instantiations that do reach this line (wide srcT), the result is not NULL and the check is a needed guard. Reporting 'always true' here is a false positive caused by instantiation-specific evaluation. ---- 6 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/d/dpp/dpp_10.1.6+dfsg.orig.tar.xz Result: your DPP-10.1.6/src/dpp/dave/session.cpp:50:1: debug: SymbolDatabase couldn't resolve all user defined types. [debug] Explanation: The PR adds a new debug message, 'SymbolDatabase couldn't resolve all user defined types', at struct queued_proposal. Its members use ::mlspp types from an external library, which were already unresolvable on main without this message. The new message most likely comes from the PR's changes to the symbol database: phases moved into finalize(), and incremental or full rebuilds after the template deduction rounds. Nothing in the code at this location changed, so the new debug output points to Cppcheck tracking types worse in this file, not to a real issue in the code. ---- 7 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/g/glbinding/glbinding_3.3.0.orig.tar.gz Result: your glbinding-3.3.0/source/tools/glqueries/main.cpp:125:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable count [valueFlowBailoutIncompleteVar] Explanation: The new debug bailout is reported inside the generic body of the function template `string`, where `count` is a non-type template parameter and therefore an incomplete variable. On main this generic definition was removed after instantiation, so no bailout was reported. The PR now keeps it, through deferred removal or the `hasRemainingCalls` check, because calls like `string(data)` cannot be deduced: the deduction only supports type parameters, not `size_t count`. ValueFlow then runs on the uninstantiated template, cannot resolve `count`, and skips the function. Nothing new is detected; the user only gets a new bailout on template code that was previously dropped. ---- 8 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/h/highway/highway_1.3.1~git20251202.ee36c83.orig.tar.xz Result: main highway-1.3.1~git20251202.ee36c83/hwy/base_test.cc:471:24: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable T [valueFlowBailoutIncompleteVar] Explanation: TestEndianGetIntegerVal is only called with deduced template arguments, e.g. TestEndianGetIntegerVal(int8_t{0x01}). On main these calls were not instantiated, so the generic body was analyzed with T unknown. That is what triggered the incomplete-variable bailout at the sizeof(T) static_assert. With the PR, T is deduced from the argument types and concrete instantiations are created, so the generic template is presumably removed. The bailout therefore disappears because Cppcheck now understands and analyzes the function with real types. ---- 9 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/i/icedtea-web/icedtea-web_1.8.8.orig.tar.xz Result: your IcedTea-Web-icedtea-web-1.8.8/tests/UnitTest++/src/ExecuteTest.h:16:21: style: Parameter 'testObject' can be declared as reference to const [constParameterReference] Explanation: `ExecuteTest` is a generic function template whose parameter type is the template parameter (`T& testObject`). The PR now deduces `T` from calls such as `ExecuteTest(*this, m_details)` in `Test::Run()`. For `T = Test`, `RunImpl()` is const, so that one instantiation could take a const reference. The warning is then reported on the generic template. Other instantiations, such as the `TEST_FIXTURE` helper structs, have a non-const `RunImpl()` and need a non-const reference. Following the advice would break those, so this is a new false positive caused by the new instantiation. ---- 10 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/i/insighttoolkit4/insighttoolkit4_4.13.3withdata-dfsg2.orig.tar.gz Result: your insighttoolkit4-4.13.3withdata-dfsg2/Modules/IO/Bruker/src/itkBruker2dseqImageIO.cxx:114:5: style: The scope of the variable 'temp' can be reduced. [variableScope] Explanation: With this PR, Cppcheck deduces T for calls like `ReverseSliceOrder(buffer, ...)` and instantiates the template, so the function body is now checked. In that body, `temp` is declared at function scope. It is only used inside the innermost loop, and it is always assigned (`temp = *toPixel`) before it is read. It could be declared there as `T temp = *toPixel;`, which works for any T and avoids a default construction followed by an assignment. The new variableScope warning is therefore a true positive found because the template is now analyzed. ---- 11 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/i/iwyu/iwyu_8.27.orig.tar.gz Result: main include-what-you-use-0.27/tests/cxx/template_args.cc:497:37: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable Nested1 < int > [valueFlowBailoutIncompleteVar] Explanation: Line 497 is inside TestMultiLevelArgs(), and the removed debug message said the whole function was skipped because of the incomplete variable 'Nested1 < int >'. The PR adds the same bailout for the same function at line 547, now naming 'Level2 < int >'. Cppcheck seems to understand Nested1 after the template changes, but valueFlowConditionExpressions still skips the function; only the first incomplete variable it reports changed. Nothing changes for users. ---- 12 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/k/kf6-kimageformats/kf6-kimageformats_6.32.0.orig.tar.xz Result: your kimageformats-6.32.0/autotests/fuzzyeq.cpp:47:28: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable Trait [valueFlowBailoutIncompleteVar] Explanation: `fuzzyeq` is only ever called with explicit template arguments (`fuzzyeq` and `fuzzyeq` in the non-template overload on line 66), so main instantiated it and removed the generic definition. The non-template overload `fuzzyeq(const QImage&, const QImage&, uchar, bool)` is presumably called elsewhere as a plain `fuzzyeq(...)`. The PR's new `hasRemainingCalls` logic matches calls by name only, so it likely treats those calls as pending calls of the template and keeps the generic definition in the token list. The uninstantiated body is then analyzed with `Trait` unknown, which triggers the new `valueFlowBailoutIncompleteVar` debug message at `sizeof(Trait)`. Cppcheck now analyzes dead generic template code it previously dropped, so it understands this code worse. ---- 13 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/k/kmc/kmc_3.2.4+dfsg.orig.tar.xz Result: your KMC-3.2.4/kmc_tools/kmer_file_header.h:84:28: style: The member function 'CKmerFileHeader::load_uint < unsigned char >' can be static. [functionStatic] KMC-3.2.4/kmc_tools/kmer_file_header.h:84:28: note: The member function 'CKmerFileHeader::load_uint < unsigned char >' can be static. KMC-3.2.4/kmc_tools/kmer_file_header.h:84:28: note: The member function 'CKmerFileHeader::load_uint < unsigned char >' can be static. Explanation: `load_uint` is a private member function template. It only uses its parameters (`file`, `res`) and calls `getc`; it never touches `this` or any data member. So it really could be static. Before the PR, calls like `load_uint(file, var)` were not instantiated because template arguments were only deduced from literals, so the function body was never checked. Now the template arguments are deduced from the variable types, the instantiations exist, and `functionStatic` correctly fires. This is a new true positive. One downside: it is reported once per instantiation (`unsigned char`, `unsigned int`, `unsigned long`), which adds some noise. ---- 14 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/l/leocad/leocad_26.09.orig.tar.gz Result: your leozide-leocad-5196355/common/lc_model.cpp:2131:8: style: Consider using std::accumulate algorithm instead of a raw loop. [useStlAlgorithm] Explanation: The loop `Step = lcMax(Step, Piece->GetStepShow())` folds every piece into one value, which is the accumulation pattern useStlAlgorithm targets. Before the PR, `lcMax` (a function template) was called without explicit template arguments and was never instantiated, so Cppcheck did not know the callee and reported nothing. With deduction (both arguments are `lcStep`), the call is now resolved to a real function and the loop is recognised. Cppcheck flags the same pattern for non-template functions. The code could indeed be written with std::accumulate (std::max_element would arguably fit better), so this is a new true positive in line with the check's intent. The removed valueFlowBailoutIncompleteVar debug messages elsewhere also point to better template understanding. ---- 15 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/l/lincity-ng/lincity-ng_2.15.0.orig.tar.gz Result: your lincity-ng-lincity-ng-2.15.0/src/lincity/xmlloadsave.cpp:979:21: style: Variable 'cst' can be declared as pointer to const [constVariablePointer] Explanation: In `saveMap()` (which takes a `const Map&`), the loop variable `cst` is only used for reads: `cst->isDead()`, `cst->constructionGroup->group`, `cst->point.x/y` passed by value to the template helper `f(...)`, and `cst->save(xmlWriter)`. In lincity-ng the save path is const (`isDead() const`, `save(...) const`), so `const Construction *cst` would compile and is a valid suggestion. The warning is likely new because the PR now deduces and instantiates `f(...)`. Before, Cppcheck could not see how `f` took its argument and conservatively assumed `cst` might be modified. With that understood, the true positive shows up. This assumes `save` and `isDead` are const member functions; if one were not, Cppcheck would normally not warn when it can see the declaration. ---- 16 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/l/log4cxx/log4cxx_1.5.0.orig.tar.gz Result: your apache-log4cxx-1.5.0/src/test/cpp/rolling/timebasedrollingtest.cpp:293:23: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable N [valueFlowBailoutIncompleteVar] Explanation: Line 293 is in the generic body of `checkFilesExist`. Its calls pass `LogString (&)[N]` arrays, so N is a non-type template parameter. The PR's type deduction rejects non-type parameters (`areAllParamsTypes`), so these calls cannot be deduced. Because of that, the new `hasRemainingCalls` / deferred-removal logic most likely keeps the generic template definition in the token list where main removed it or never reached it. ValueFlow then analyzes the uninstantiated body, finds N with no declaration, and emits a new `valueFlowBailoutIncompleteVar` bailout. This adds no analysis value and only means Cppcheck now looks at code it cannot understand, so it counts as a new debug/bailout regression. ---- 17 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/l/lyx/lyx_2.5.3.orig.tar.xz Result: your lyx-2.5.3/src/support/Changer.h:40:2: style: Class 'RevertibleRef < lyx :: MathStyle >' has a constructor with 1 argument that is not explicit. [noExplicitConstructor] Explanation: `RevertibleRef(X & ref)` is a single-argument constructor that is not marked `explicit`, so the noExplicitConstructor style warning is valid. Before the PR, cppcheck never instantiated `RevertibleRef`, because calls like `changeVar(ref, val)` and `make_save(ref)` give no explicit template arguments. The PR now deduces `X = lyx::MathStyle` from the argument types, which instantiates `changeVar`/`make_save` and through them `RevertibleRef`, so the class gets checked. The deduced type is plausible: MathStyle is an enum in namespace lyx. The finding is a new true positive. The only drawback is that the same source line is reported once per instantiation. ---- 18 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libo/libosl/libosl_0.8.0.orig.tar.gz Result: your libosl-0.8.0.orig/core/osl/numEffectState.cc:838:9: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable show_error [valueFlowBailoutIncompleteVar] Explanation: Line 838 is inside the generic body of `template isAlmostValidMove`. That template is only ever used through explicit instantiations (`isAlmostValidMove` and `isAlmostValidMove`). Before the PR, the generic declaration was removed after instantiation, so its body was never analyzed. With the PR, removal is deferred (pending type deductions) and the declaration is kept, probably because `hasRemainingCalls` sees other plain calls to the non-template overload `isAlmostValidMove(move)` that share the same name. As a result, the uninstantiated template body stays in the token list. ValueFlow then treats the non-type template parameter `show_error` as an incomplete variable and bails out. This new debug bailout shows Cppcheck now handles this code worse: it keeps and analyzes generic template code that should have been removed. ---- 19 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libo/libosl/libosl_0.8.0.orig.tar.gz Result: your libosl-0.8.0.orig/core/osl/simpleState.cc:353:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable show_error [valueFlowBailoutIncompleteVar] Explanation: Line 353 is inside the generic body of `template bool SimpleState::isAlmostValidMove(Move) const`. That template is already instantiated through the explicit calls `isAlmostValidMove(move)` and `isAlmostValidMove(move)`. Before the PR, the generic definition was removed after instantiation. With the PR it stays in the token list, probably because the new name-based `hasRemainingCalls`/deferred-removal logic treats plain calls of the same name as remaining calls of the template. One candidate is calls to the non-template overload `isAlmostValidMove(Move, bool)`. As a result, the uninstantiated template body is analyzed with the non-type template parameter `show_error` as an unknown variable, which produces this new bailout. The same pattern of new bailouts on template parameters (P, T, Turn, KingOwner) appears throughout the package. Cppcheck now analyzes code it does not understand, which is a regression. ---- 20 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libx/libxsmm/libxsmm_1.17.orig.tar.gz Result: main libxsmm-1.17/samples/cp2k/mdarray.hpp:312:17: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable pu [valueFlowBailoutIncompleteVar] Explanation: `pu` is a non-type template parameter of the member template `at_idx`. In main, the uninstantiated generic body was analysed with `pu` as an unknown, incomplete variable, so ValueFlow bailed out of the function. With the PR, function template calls get their arguments deduced and instantiated. The instantiated body substitutes `pu` with a concrete value, so the bailout no longer applies. The same file also loses the `dims_` incomplete-variable bailout and gains a real `useStlAlgorithm` finding at line 692, which suggests the code is now understood better rather than skipped. Removing this debug bailout is therefore an improvement. Confidence is medium because the instantiation itself is not shown. ---- 21 / 50 ---- Verdict: IMPROVEMENT (low confidence) Package: https://ftp.debian.org/debian/pool/main/m/metview/metview_5.27.0.orig.tar.gz Result: your Metview-5.27.0-Source/atlas/src/atlas/grid/detail/grid/Regional.cc:240:76: style:inconclusive: Function 'parse' argument 2 names different: declaration '' definition 'config'. [funcArgNamesDifferentUnnamed] Explanation: ConfigParser most likely declares the template `parse` in the class with unnamed parameters (`const Projection&, const Grid::Config&, ...`); that declaration is not shown. The out-of-class definition at line 240 names them `projection` and `config`. Now that the member template is instantiated (the calls at lines 252–278), cppcheck checks the instantiated function. It reports the same unnamed-versus-named difference it would report for the non-template overload at line 250. Column 76 points at `config`, which is correct. The finding is technically accurate under this inconclusive style check, so it is a valid new true positive. The practical value is small, since unnamed parameters in declarations are common and harmless. ---- 22 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/m/monero/monero_0.18.5.3+~0+20260428.orig.tar.gz Result: main monero-project-monero-a759b82/src/device_trezor/trezor/debug_link.cpp:68:19: style: The member function 'hw::trezor::DebugLink::input_button' can be static. [functionStatic] monero-project-monero-a759b82/src/device_trezor/trezor/debug_link.hpp:52:10: note: The member function 'hw::trezor::DebugLink::input_button' can be static. monero-project-monero-a759b82/src/device_trezor/trezor/debug_link.cpp:68:19: note: The member function 'hw::trezor::DebugLink::input_button' can be static. Explanation: `input_button()` calls `call(decision, boost::none, true)`. `call` is a member function template of DebugLink, declared in debug_link.hpp, that sends the message through `m_transport`. On main the call has no explicit template arguments and was never instantiated. Cppcheck therefore did not see that the member function uses instance state and wrongly said it can be static. With the PR, the template argument is deduced from the type of `decision`, so `call` is instantiated and linked to its definition. Cppcheck now sees the member access, and the functionStatic false positive is gone. The same applies to the other three removed warnings. ---- 23 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/m/mplapack/mplapack_3.0.1+ds.orig.tar.xz Result: your mplapack-3.0.1/examples/mplapack/03_SymmetricEigenproblems/Cheev_test_double.cpp:30:7: style: The scope of the variable 'mtmp' can be reduced. [variableScope] Explanation: With the PR, Cppcheck deduces the template argument for the call `printmat(n, n, A, n)` and instantiates the function template, so its body is now checked. In `printmat`, `mtmp` is declared at function scope but only used inside the inner loop: it is assigned `a[i + j * lda]` and then immediately passed to `printnum`. The declaration could move into the inner loop without changing behaviour, whether X is double or std::complex. The new variableScope style warning is therefore a true positive that was missed while the template was not instantiated. ---- 24 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/n/neartree/neartree_5.1.1+dfsg1.orig.tar.gz Result: main neartree-5.1.1+dfsg1/TNear.h:10870:32: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable end [valueFlowBailoutIncompleteVar] Explanation: In this function `end` is an enumerator of the direction enum (left/right/end), not an unknown variable. Main treated it as an incomplete variable and skipped valueFlowConditionExpressions for the whole function. The PR moves createSymbolDatabaseIncompleteVars into finalize(), which runs after template simplification. It also re-resolves eEnumerator tokens that template copies left without an enumerator. With both changes, `end` is now linked to its enumerator. The bailout disappearing therefore reflects better understanding of the code, not lost analysis: other warnings for the same class are still reported, only with a more qualified name. ---- 25 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/n/neartree/neartree_5.1.1+dfsg1.orig.tar.gz Result: your neartree-5.1.1+dfsg1/TNear.h:4309:14: style:inconclusive: Technically the member function 'CNearTree < v , double , -1 >::NearTreeNode < v , double , -1 >::get_fields' can be const. [functionConst] Explanation: get_fields() only reads members into reference out-parameters, so it can indeed be const. The warning was already reported by main; only the class name in the message changed. It is now the fully qualified 'CNearTree<...>::NearTreeNode<...>' instead of just 'NearTreeNode<...>'. NearTreeNode is a nested class of CNearTree, so the qualified name is more accurate. This matches the PR's fix that keeps class template instantiation names as one token in scope qualification. ---- 26 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/n/neochat/neochat_26.08.2.orig.tar.xz Result: your neochat-26.08.2/src/libneochat/enums/roomsortparameter.cpp:16:37: style: Comparison of a variable having boolean value using relational (<, >, <= or >=) operator. [comparisonOfBoolWithBoolError] Explanation: With the PR, `typeCompare(left, right)` calls are now deduced and instantiated, including a `typeCompare` instantiation (probably from the HasUnread/HasHighlight sort parameters). The warning is reported on the generic template line `left > right`. That line is a three-way comparator meant to work for any T, and ordering bools with `>` is intentional and well defined (false < true) when sorting rooms. The user cannot change this line for the bool case without adding a specialization. So this style warning is noise caused by the template instantiation: the check should ignore operands whose type comes from a template argument, as the PR already does for testIfNonZeroExpressionIsPositive. This is a new false positive. ---- 27 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/n/node-sqlite3/node-sqlite3_6.0.1+ds1.orig.tar.xz Result: your TryGhost-node-sqlite3-a7badce/src/statement.cc:223:86: style:inconclusive: Function 'Bind' argument 3 names different: declaration 'end' definition 'last'. [funcArgNamesDifferent] TryGhost-node-sqlite3-a7badce/src/statement.h:219:83: note: Function 'Bind' argument 3 names different: declaration 'end' definition 'last'. TryGhost-node-sqlite3-a7badce/src/statement.cc:223:86: note: Function 'Bind' argument 3 names different: declaration 'end' definition 'last'. Explanation: The member template `Statement::Bind` is declared in statement.h with its third parameter named `end`, while the out-of-class definition at statement.cc:223 names it `last`. That mismatch is real, so the new funcArgNamesDifferent warning is a true positive. It most likely appears now because the PR changes how the template is instantiated or handled in the symbol database, so the declaration and definition are matched and compared. Adding a correct, if minor, style finding is an improvement. ---- 28 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/n/nss-pem/nss-pem_1.1.1+1.orig.tar.xz Result: your nss-pem-1.1.1+1/nss/nss/gtests/google_test/gtest/src/gtest-printers.cc:286:34: style: Condition '1<=c' is always true [knownConditionTrueFalse] nss-pem-1.1.1+1/nss/nss/gtests/google_test/gtest/src/gtest-printers.cc:279:9: note: Assuming that condition 'c==0' is not redundant nss-pem-1.1.1+1/nss/nss/gtests/google_test/gtest/src/gtest-printers.cc:286:34: note: Condition '1<=c' is always true Explanation: The source file was not in the package, so this relies on the well-known gtest code. Around these lines, `PrintCharAndCodeTo(Char c, ...)` does `if (c == 0) return;` and later tests `format == kHexEscape || (1 <= c && c <= 9)`. The new type deduction instantiates the template with an unsigned char type. For that instantiation `1<=c` is indeed always true after the `c==0` early return. But the same generic code is also instantiated for signed types such as `wchar_t` or `char`, where `c` can be negative, so the condition is needed. Reporting a known condition that only holds for one template instantiation is a false positive, and the user cannot fix it in the template. This is a new false positive. ---- 29 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/o/openscenegraph/openscenegraph_3.6.5+dfsg1.orig.tar.gz Result: your OpenSceneGraph-OpenSceneGraph-3.6.5/src/osgDB/ClassInterface.cpp:46:21: portability:inconclusive: Casting from double * to char * is not portable due to different binary data representations on different platforms. [invalidPointerCast] Explanation: The PR now deduces `write` from `writeDouble(d)` and instantiates the template. The existing invalidPointerCast check then flags `reinterpret_cast(&t)` with T=double. This code is the standard, well-defined way to copy an object's raw bytes: char may alias any type. The bytes go into an in-memory `std::string` that is read back by the matching PropertyInputIterator in the same process. Differing binary representations across platforms therefore do not apply. The new instantiation is technically correct, but it exposes a char* cast case that the check itself treats as doubtful. The added warning is effectively a false positive. ---- 30 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/o/openscenegraph/openscenegraph_3.6.5+dfsg1.orig.tar.gz Result: your OpenSceneGraph-OpenSceneGraph-3.6.5/src/osgDB/ClassInterface.cpp:46:21: portability:inconclusive: Casting from float * to char * is not portable due to different binary data representations on different platforms. [invalidPointerCast] Explanation: With the PR, Cppcheck deduces T for the calls `write(f)` and `write(d)` (from writeFloat and writeDouble) and instantiates `write` and `write`. In those instances `reinterpret_cast(&t)` casts a `float*` to `char*`. The same code written without a template would get this same inconclusive warning, so the check now just sees the instantiated code. The warning's point also fits here: the function copies the raw float bytes into a binary property stream, and that byte layout depends on the platform. The cast is legal C++, and the warning is inconclusive by design. Overall this is a new, consistent true positive from better template handling, not a parsing mistake. ---- 31 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/p/parallel-hashmap/parallel-hashmap_1.4.1+ds.orig.tar.xz Result: main parallel-hashmap-1.4.1/examples/hash_bench.cc:75:7: style: The member function 'sfc64::rotl' can be static. [functionStatic] Explanation: The private member template rotl(T const x, int k) uses no members, so the functionStatic warning is valid in both runs. The PR now deduces T=uint64_t from the call rotl(m_c, rotation) and instantiates rotl. The warning is therefore reported on the instantiation, named 'sfc64::rotl < unsigned long >'. The removed main line is the same true positive under its old name, so this is a message text change. The warning is still correct. The related valueFlowBailoutIncompleteVar debug message for T also disappeared, which shows Cppcheck now understands the code better. ---- 32 / 50 ---- Verdict: REGRESSION (low confidence) Package: https://ftp.debian.org/debian/pool/main/p/perfetto/perfetto_59.1.orig.tar.gz Result: your perfetto-59.1/src/profiling/perf/event_reader.cc:45:22: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable T [valueFlowBailoutIncompleteVar] Explanation: The new line is a debug bailout, `valueFlowConditionExpressions` skipping a function because of an incomplete variable T. It points into the generic body of `template ReadValues(T* out, ...)`, at `sizeof(T)`. Main did not report it, so with the PR the uninstantiated generic definition is apparently still in the token list and analyzed. The likely cause is the PR's new logic that keeps (or no longer removes) the generic definition when some calls could not be deduced. The other `ReadValues` calls were probably not deduced, for example arguments from a container's `data()`. ValueFlow then gives up on the template body because T is not a known type. A new bailout on a generic template body means Cppcheck now handles this code less well, not better. Cppcheck's output alone does not show exactly why the definition was kept, hence low confidence. ---- 33 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/p/piglit/piglit_0~git20220119-124bca3c9.orig.tar.xz Result: main piglit_0~git20220119-124bca3c9-1/tests/egl/spec/egl_ext_platform_device/egl_ext_platform_device.c:83:4: portability: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn] Explanation: Line 83 returns the result of a call through the function pointer `peglGetPlatformDisplayEXT`, which is declared as `EGLDisplay (*)(...)`. `EGLDisplay` is an opaque pointer type, not an integer. Main got the call's type wrong: it derived it from the pointer variable itself and treated it as an integer, so the CastIntegerToAddressAtReturn warning was a false positive. The PR gives function-pointer variables a FUNCTION value type and types a call through them from the declared return type. The bogus warning therefore disappears. ---- 34 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/q/qelectrotech/qelectrotech_0.9.orig.tar.gz Result: your qet-0.9/sources/pugixml/pugixml.cpp:8863:46: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable T [valueFlowBailoutIncompleteVar] Explanation: Line 8863 is inside the generic body of `template T* new_xpath_variable(const char_t*)`. Every call to it passes explicit template arguments (`new_xpath_variable(name)` etc.), so main instantiated it and removed the generic definition. The PR's new `hasRemainingCalls` check only matches by name. It finds plain calls `new_xpath_variable(type, name)`, which actually call the non-template 2-argument overload, and so keeps the uninstantiated template body. ValueFlow then sees the unresolved `T` in `sizeof(T)` and emits the new valueFlowBailoutIncompleteVar debug message. This is a new bailout caused by code that should have been removed, so Cppcheck understands the code worse. ---- 35 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/q/qnapi/qnapi_0.2.3.orig.tar.xz Result: main qnapi-0.2.3/deps/qt-maybe/Maybe.h:92:2: style: Struct 'JustType' has a constructor with 1 argument that is not explicit. [noExplicitConstructor] Explanation: Main reported the warning on the generic template 'JustType' at line 92. With the PR, the call just(ptr) is now deduced, so the template is instantiated as 'JustType < int * >' and the same warning is reported for the concrete instantiation. The partial specialization at line 92 does have a non-explicit one-argument constructor, so the warning is a true positive either way. The new message names the concrete instantiation, which is more precise. The change is a replacement of the message text, not a lost warning, so it is a small improvement. ---- 36 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/r/r-other-x4r/r-other-x4r_1.0.1+git20150806.c6bd9bd.orig.tar.xz Result: main r-other-x4r-1.0.1+git20150806.c6bd9bd/src/rapidxml.hpp:1487:21: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable Quote [valueFlowBailoutIncompleteVar] Explanation: Line 1487 tests the non-type template parameter `Quote` of `attribute_value_pred`. Main bailed out on the incomplete variable `Quote`. With the PR, `Quote` is substituted, but the same function is still skipped: the paired 'your' line reports a bailout one line later, on the incomplete variable `lookup_attribute_data_1`. Every other Flags/Quote bailout in this package moves the same way. ValueFlow still skips the function, so users see no difference; only the debug text changed. ---- 37 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/r/rna-star/rna-star_2.7.11b+dfsg.orig.tar.xz Result: your STAR-2.7.11b/source/SimpleGoodTuring/sgt.h:92:31: style: The member function 'SGT < unsigned int >::sq < unsigned int >' can be static. [functionStatic] STAR-2.7.11b/source/SimpleGoodTuring/sgt.h:92:31: note: The member function 'SGT < unsigned int >::sq < unsigned int >' can be static. STAR-2.7.11b/source/SimpleGoodTuring/sgt.h:92:31: note: The member function 'SGT < unsigned int >::sq < unsigned int >' can be static. Explanation: `sq` is a member function template, `template double sq(T d) { return ((double) d)*d; }`, and it uses no members or `this`, so it really could be static. Before the PR the call `sq(x)` with an `unsigned int` argument was never instantiated, because the template arguments were not deduced, so the body was not checked. The PR now deduces `T` and instantiates `SGT::sq`, and functionStatic correctly reports it. This is a new true positive. The message names the instantiation rather than the generic template, which is a small cosmetic oddity, but the warning is valid. ---- 38 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/r/rocalution/rocalution_7.2.4.orig.tar.gz Result: your rocALUTION-rocm-7.2.4/clients/benchmarks/rocalution_driver_itsolver_traits.hpp:112:1: debug: SymbolDatabase couldn't resolve all user defined types. [debug] Explanation: This is a new debug message, 'SymbolDatabase couldn't resolve all user defined types', on a partial specialization of a traits class template. The source did not change, so main resolved these types and the PR does not. The same message appears on many similar specializations and on driver headers in this package. That pattern suggests the PR's new type-deduction rounds or the symbol database rebuild/update leave type pointers unset in templated code. Cppcheck now understands this code worse. ---- 39 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/s/scid/scid_4.7.4+dfsg1.orig.tar.bz2 Result: your scid-4.7.4/src/filebuf.h:171:7: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable nBytes [valueFlowBailoutIncompleteVar] Explanation: `nBytes` is a non-type template parameter of the private member template `read()`. Main reported nothing here, which suggests the generic template body was removed after it was instantiated. With the PR, the generic definition stays in the token list. The likely cause is the new deferred removal or the 'remaining calls' logic. ValueFlow then sees `nBytes` as an unknown variable and emits a new valueFlowBailoutIncompleteVar debug message. This is a new bailout caused by leftover uninstantiated template code, not by better understanding of the code. ---- 40 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/s/shasta/shasta_0.14.0.orig.tar.gz Result: main paoloshasta-shasta-6c634aa/src/MemoryMappedObject.hpp:473:5: debug: CheckClass::isMemberVar found used member variable 'isOpen' with varid 0 [varid0] Explanation: In main, the varid0 debug message shows that the member 'isOpen' used in the out-of-class member Object::unmap() had no variable id. That means Cppcheck did not link the member usage to its declaration. With the PR the message is gone, and the related uninitMemberVar warnings are gone too. The new messages at the same lines only bail out on __PRETTY_FUNCTION__, which comes from the assert macro; isOpen is no longer the incomplete variable. So Cppcheck now resolves the class members correctly, and the removed debug message reflects better understanding of the code. ---- 41 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/s/shasta/shasta_0.14.0.orig.tar.gz Result: main paoloshasta-shasta-6c634aa/src/MemoryMappedVector.hpp:550:9: debug: CheckClass::isMemberVar found used member variable 'isOpen' with varid 0 [varid0] Explanation: Line 550 is in the out-of-line member function template definition Vector::createNewAnonymous, and `isOpen` is a member of the class template. Main emitted a varid0 debug message there, meaning the member variable was not resolved. That points to a mismatch between the template definition and its instantiation. With the PR, the many varid0 and incomplete-variable bailouts for these members disappear across MemoryMappedVector.hpp, and so do the related uninitMemberVar false positives. This suggests Cppcheck now handles this code better. Removing an internal debug message about an unresolved member is an improvement. ---- 42 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/s/shotcut/shotcut_26.11.15+ds.orig.tar.xz Result: your mltframework-shotcut-a95318e/src/widgets/avformatproducerwidget.h:167:1: debug: SymbolDatabase couldn't resolve all user defined types. [debug] Explanation: This debug message is new: it appears only with the PR, at the class ProbeTask declaration. The class derives from external Qt types (QObject, QRunnable) and has an Mlt::Producer member. Main did not report this, so after the PR's new template-deduction rounds and the changed symbol database construction (rebuild/incremental update, phases moved to finalize()), Cppcheck resolves the types in this header worse than before. The code is unchanged, so a new debug or bailout message counts as a regression. ---- 43 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/s/simgear/simgear_2024.1.5+dfsg.orig.tar.xz Result: main simgear-2024.1.5/simgear/math/SGGeometryTest.cxx:42:18: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable T [valueFlowBailoutIncompleteVar] Explanation: Line 42 is inside the function template `TriangleClosestPointIntersectionTest`. On main, Cppcheck analyzed the uninstantiated generic body, so `T` looked like an unknown variable and valueflow bailed out on the whole function. With the PR, the template is instantiated and the generic definition is removed. The same file also gains `noExplicitConstructor` warnings for `SGTriangle`/`SGTriangle`, and the T-bailouts elsewhere become cout-bailouts in instantiated code, which shows instantiation now happens. The bailout disappearing because `T` is now resolved to concrete types means Cppcheck understands the code better. ---- 44 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/s/simgear/simgear_2024.1.5+dfsg.orig.tar.xz Result: your simgear-2024.1.5/simgear/math/SGGeometryTest.cxx:161:16: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable cout [valueFlowBailoutIncompleteVar] Explanation: This line is the same bailout for the same function, `TriangleLineIntersectionTest`, reported on a different variable. In main, valueFlowConditionExpressions skipped the function because the template parameter `T` was incomplete at line 141. With the PR, `T` is resolved, likely because the template is now handled through the new instantiation and deduction logic. The first incomplete variable it hits is now `std::cout` at line 161. The function is still skipped for condition-expression analysis, so nothing changes for users. Cppcheck understands the template types slightly better, but the bailout outcome is the same. ---- 45 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/t/tortoize/tortoize_2.0.16.orig.tar.gz Result: your tortoize-2.0.16/src/tortoize.cpp:805:8: style: Variable 'pv' can be declared as pointer to const [constVariablePointer] Explanation: The PR now deduces `byteswap(mean)` as `byteswap`, so the template body gets instantiated and checked. In it, `pv` is only read (`presult[size - 1 - i] = pv[i]`) and never written through, so it could be declared `const char *pv = (const char *)&v;`. The constVariablePointer warning is a correct new true positive. ---- 46 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/v/vtk-dicom/vtk-dicom_0.8.17.orig.tar.gz Result: main vtk-dicom-0.8.17/Source/vtkDICOMValue.cxx:501:19: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable T [valueFlowBailoutIncompleteVar] Explanation: The removed line is a debug bailout in the generic template body of vtkDICOMValue::CreateValue. It bailed out because T was an incomplete variable in the uninstantiated template. With the PR, the calls are deduced and the template is instantiated (CreateValue, , etc.). As a result the generic T no longer appears in sizeof(T) and this bailout is gone. Cppcheck now understands this code better. A bailout still remains at line 509 for VTK_UNSIGNED_CHAR, but that one comes from an unknown macro, not from the template parameter. ---- 47 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/v/vtk-dicom/vtk-dicom_0.8.17.orig.tar.gz Result: your vtk-dicom-0.8.17/Source/vtkDICOMValue.cxx:497:70: style:inconclusive: Function 'CreateValue < unsigned short >' argument 3 names different: declaration 'count' definition 'n'. [funcArgNamesDifferent] vtk-dicom-0.8.17/Source/vtkDICOMValue.h:454:57: note: Function 'CreateValue < unsigned short >' argument 3 names different: declaration 'count' definition 'n'. vtk-dicom-0.8.17/Source/vtkDICOMValue.cxx:497:70: note: Function 'CreateValue < unsigned short >' argument 3 names different: declaration 'count' definition 'n'. Explanation: The underlying finding is real: the header declares parameter 3 of `CreateValue` as `count`, while the template definition at line 497 calls it `n`. Main reported this once, for the template `CreateValue`. With the PR, deduced instantiations are created and the same finding is reported once per instantiation: 8 identical warnings at the same source location. Each names an instantiation such as `CreateValue < unsigned short >` instead of the function as written in the source. This is duplicate noise with a less accurate function name, not new information. ---- 48 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/x/xaos/xaos_4.3.8.orig.tar.gz Result: main xaos-4.3.8/src/util/xmenu.cpp:489:27: style: C-style pointer casting [cstyleCast] Explanation: Line 489 casts `control`, a pointer to `int(struct uih_context*, int)`, to the unrelated function pointer type `int (*)(void)`. Calling through the result without casting it back is undefined behaviour. In C++ this conversion needs a reinterpret_cast; static_cast cannot do it. The PR gives function pointers a FUNCTION ValueType, so Cppcheck now recognises the cast as a reinterpret-style conversion. It therefore replaces the generic style warning cstyleCast with the warning dangerousTypeCast. The new classification describes this code more accurately, so removing the cstyleCast line in favour of dangerousTypeCast is an improvement. ---- 49 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/x/xaos/xaos_4.3.8.orig.tar.gz Result: your xaos-4.3.8/src/util/xmenu.cpp:489:27: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] Explanation: Line 489 casts `control`, an `int (*)(uih_context*, int)`, to the incompatible function pointer type `int (*)(void)`. Main gave `control` a wrong ValueType (roughly `int *`). That made the source and target look like the same primitive type, so it only reported the generic style `cstyleCast`. With the PR, `control` is typed as FUNCTION, so the cast is recognised as a conversion between different types and reported as `dangerousTypeCast`. That fits the code better: the function signatures differ, and calling through the converted pointer without casting it back is undefined behaviour. The analogous cast on line 488, `void(*)(void)`, was presumably already classified this way, since it does not appear in the diff. The message is now more accurate. ---- 50 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/z/zimlib/zimlib_8.1.1.orig.tar.gz Result: your libzim-8.1.1/src/debug.h:41:63: error: Null pointer dereference: b [ctunullpointer] libzim-8.1.1/src/compression.cpp:132:7: note: Assignment '_right=0u', assigned value is 0 libzim-8.1.1/src/compression.cpp:132:7: note: Assuming condition is true libzim-8.1.1/src/compression.cpp:132:7: note: Calling function _on_assert_fail < unsigned long , unsigned int >, 5th argument is null libzim-8.1.1/src/debug.h:41:63: note: Dereferencing argument b that is null Explanation: The PR now instantiates `_on_assert_fail` by deducing its template arguments from the call. In that instance `b` is a plain `unsigned int` value. `<< b` only prints the integer, and an integer value of 0 is not a null pointer. The new ctunullpointer error claiming argument b is dereferenced while null is therefore a false positive introduced by the new instantiation.