AI review of 2026-10-27_02-21-20-f079e2188f38-results.txt PR: #8720 https://github.com/cppcheck-opensource/cppcheck/pull/8720 Tested: f079e2188f38195619891f6dc819a099f2c20256 Merge base: ef06677d725d82e8da3e52a5a1dd090c86b0762b Reviewed: 2026-10-28 13:09:57 UTC Model: claude-opus-5-5 (effort high) Results: 50 reviewed of 404 in the report (random sample) Verdicts: 7 improvement, 4 neutral, 38 regression, 1 unclear Tokens: 98972 input, 3109400 cache read, 777350 cache write, 38294 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/akonadi-contacts/akonadi-contacts_26.08.2.orig.tar.xz Result: your akonadi-contacts-26.08.2/src/akonadi-contacts-core/abstractcontactgroupformatter.cpp:16:1: debug: SymbolDatabase couldn't resolve all user defined types. [debug] Explanation: The PR adds a new debug message on the private class `Akonadi::AbstractContactGroupFormatterPrivate`. Its members are `KContacts::ContactGroup`, `Akonadi::Item` and `QList`. This code contains no function template calls that the new deduction would instantiate. The message most likely comes from the need-initialization pass (`createSymbolDatabaseNeedInitialization`), which the PR moved into `finalize()`, so it now runs later on a changed symbol database. With the same input, Cppcheck now reports that it could not resolve all user-defined types where it did not before. That points to a side effect of the restructuring, not better understanding of the code: a new debug/bailout message, so a regression. ---- 2 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/a/apache-arrow/apache-arrow_25.0.0.orig.tar.gz Result: main apache-arrow-25.0.0/c_glib/arrow-glib/array-builder.cpp:281:44: style: Parameter 'values' can be declared as pointer to const [constParameterPointer] Explanation: `values` is a `GBytes *` that is passed to `g_bytes_get_data(GBytes *bytes, gsize *size)`. That GLib function takes a non-const `GBytes *`, so declaring the parameter as `const GBytes *` would not compile without a cast. The constParameterPointer warning was therefore a false positive. Its disappearance, likely due to the changed template instantiation/analysis in this function template, is good for users. ---- 3 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/a/apache-arrow/apache-arrow_25.0.0.orig.tar.gz Result: main apache-arrow-25.0.0/cpp/src/arrow/util/int_util.cc:543:18: style: Unsigned expression 'val' can't be negative so it is unnecessary to test it. [unsignedPositive] Explanation: `val` has type `IndexCType`, a template parameter. `CheckIndexBoundsImpl` is instantiated for both signed and unsigned index types, so `val >= 0` is needed for the signed instantiations. The unsignedPositive warning came from an unsigned instantiation (uint8_t to uint64_t) and suggests removing a test the generic code needs. The PR skips the check when the variable's type comes from a template argument, which removes this false positive. ---- 4 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/a/arpack/arpack_3.9.1.orig.tar.gz Result: your arpack-ng-3.9.1/TESTS/icb_arpack_cpp.cpp:95:13: warning: The address of variable 'workd' might be accessed at non-zero index. [objectIndex] arpack-ng-3.9.1/TESTS/icb_arpack_cpp.cpp:61:36: note: Address of variable taken here. arpack-ng-3.9.1/TESTS/icb_arpack_cpp.cpp:61:36: note: Calling function 'diagonal_matrix_vector_product < double >', 1st argument '&(workd[ipntr[0]-1])' value is lifetime=workd arpack-ng-3.9.1/TESTS/icb_arpack_cpp.cpp:95:13: note: The address of variable 'workd' might be accessed at non-zero index. Explanation: `workd` is a `std::vector` of 3*N elements, so `&(workd[ipntr[0]-1])` points into its heap buffer. Indexing `x[i]`/`y[i]` from that pointer is a normal array access, not an access past a single object. The PR now instantiates the deduced `diagonal_matrix_vector_product` call, and the lifetime analysis wrongly treats the element address as the address of the variable `workd` itself. The note also points line 61, which passes `Real` pointers, at line 95, which is the complex overload, suggesting the deduced call may be linked to the wrong overload. The new objectIndex warning is a false positive. ---- 5 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/c/ccls/ccls_0.20261004.orig.tar.gz Result: your ccls-0.20261004/index_tests/constructors/make_unique_forward.cc:2:37: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable args [valueFlowBailoutIncompleteVar] Explanation: Line 2 is the body of the variadic function template `fake_make_unique`. It is only called with explicit template arguments (`fake_make_unique(...)`), which Cppcheck already instantiated before this PR. After the PR, ValueFlow reports a new bailout because the pack parameter `args` is an incomplete variable. That suggests the tokens it now analyses still contain the unresolved parameter pack, most likely because the generic template body is kept or copied by the new deferred-removal and deduction logic. The PR adds no warning for this code; it only adds a bailout, so Cppcheck understands this function less well than before. ---- 6 / 50 ---- Verdict: REGRESSION (low confidence) Package: https://ftp.debian.org/debian/pool/main/c/ccls/ccls_0.20261004.orig.tar.gz Result: your ccls-0.20261004/index_tests/templates/template_class_func_usage_folded_into_one.cc:2:1: error: The one definition rule is violated, different classes/structs have the same name 'Foo < bool >' [ctuOneDefinitionRuleViolation] ccls-0.20261004/index_tests/templates/template_class_template_func_usage_folded_into_one.cc:2:1: note: The one definition rule is violated, different classes/structs have the same name 'Foo < bool >' ccls-0.20261004/index_tests/templates/template_class_func_usage_folded_into_one.cc:2:1: note: The one definition rule is violated, different classes/structs have the same name 'Foo < bool >' Explanation: The new error says `Foo` violates the one definition rule. It compares two separate ccls index test inputs, `template_class_func_usage_folded_into_one.cc` and `template_class_template_func_usage_folded_into_one.cc`. Each is a standalone test file with its own `template struct Foo`, and the two are never linked into one program. The warning probably appears now because the PR changes how member templates of class instantiations are expanded and removed, so the two instantiated `Foo` bodies no longer compare as equal or skipped. The definitions do differ textually, but users get no real ODR problem from unrelated standalone test files. A new cross-file error here is noise, so this leans toward a regression rather than a useful new finding. ---- 7 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/c/clips/clips_6.30.orig.tar.gz Result: main clips_core_source_630/core/evaluatn.c:280:44: portability: Casting between signed int * and double * which have an incompatible binary data representation. [invalidPointerCast] Explanation: At line 280, `fptr->functionPointer` is a function pointer (probably declared `int (*functionPointer)(...)`). The code casts it to another function pointer type, `double (*)(void *)`, and calls it. Main parsed the function-pointer declaration as `int *`, so it treated this as a data-pointer cast from `int *` to `double *` and reported invalidPointerCast. That is a false positive: no int or double data is reinterpreted, only the function pointer type changes. The PR adds a FUNCTION ValueType for parenthesized function-pointer declarators, so the cast source is no longer seen as `int *` and the false positive disappears. ---- 8 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/c/clips/clips_6.30.orig.tar.gz Result: main clips_core_source_630/core/evaluatn.c:285:44: portability: Casting between signed int * and double * which have an incompatible binary data representation. [invalidPointerCast] Explanation: Line 285 casts the generic function pointer `fptr->functionPointer` (an `int (*)()`) to `double (*)(void)` and calls it. No data object is reinterpreted as `int *` or `double *`; these are function-pointer types. Main misread the parenthesized declarators as plain data pointers (`int *` and `double *`), so the invalidPointerCast warning is a false positive. The PR adds a FUNCTION ValueType for parenthesized function-pointer declarators, so Cppcheck now understands the cast and drops the warning. ---- 9 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/f/feather-wallet/feather-wallet_2.8.1+dfsg.orig.tar.xz Result: main feather-2.8.1/monero/src/device_trezor/trezor/debug_link.cpp:62:19: style: The member function 'hw::trezor::DebugLink::input_word' can be static. [functionStatic] feather-2.8.1/monero/src/device_trezor/trezor/debug_link.hpp:50:10: note: The member function 'hw::trezor::DebugLink::input_word' can be static. feather-2.8.1/monero/src/device_trezor/trezor/debug_link.cpp:62:19: note: The member function 'hw::trezor::DebugLink::input_word' can be static. Explanation: `input_word` calls `call(decision, boost::none, true)`. `call` is a member function template of `DebugLink`, and in the header it uses `m_transport`. So `input_word` cannot be static, and the old functionStatic warning was a false positive. In main, the generic template definition was removed after the explicit instantiation `call` in `state()`. That left the plain `call(...)` unresolved, so Cppcheck thought the function used no members. With the PR, a template definition that still has undeduced calls is kept. The call now resolves to the non-static member and the false positive disappears. ---- 10 / 50 ---- Verdict: REGRESSION (low confidence) Package: https://ftp.debian.org/debian/pool/main/f/fife/fife_0.4.3.orig.tar.gz Result: your fifengine-0.4.3/engine/core/vfs/raw/rawdata.h:174:28: style: The member function 'FIFE::RawData::revert < unsigned short >' can be static. [functionStatic] fifengine-0.4.3/engine/core/vfs/raw/rawdata.h:174:28: note: The member function 'FIFE::RawData::revert < unsigned short >' can be static. fifengine-0.4.3/engine/core/vfs/raw/rawdata.h:174:28: note: The member function 'FIFE::RawData::revert < unsigned short >' can be static. Explanation: `revert` uses no members (only `value`, `retval` and `sizeof(T)`), so 'can be static' is a true positive. Main already reported it once for the generic template. The PR now deduces the calls `revert(value)` and creates `revert` and `revert`, so the same finding is reported once per instantiation at the same line. This added line is a duplicate of the same issue. Its name 'revert < unsigned short >' is also less accurate, because the user can only make the template itself static, not one instantiation. The disappearing bailout message is a side benefit, but this line itself adds noise rather than a new finding. ---- 11 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/g/gcr4/gcr4_4.4.1.orig.tar.xz Result: your gcr-4.4.1/egg/egg-secure-memory.c:1140:4: portability: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn] Explanation: `EGG_SECURE_GLOBALS.fallback` is a function pointer declared as `void* (*fallback)(void*, size_t)`, so the call returns `void*`. Returning it from a pointer-returning function is correct, and no integer is returned. The PR's new FUNCTION value type handling for calls through function pointers infers the wrong type for this member call. The resulting CastIntegerToAddressAtReturn warning is a new false positive. ---- 12 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/g/glob2/glob2_0.9.4.4.orig.tar.gz Result: your glob2-0.9.4.4/src/Map.cpp:3040:33: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] Explanation: `listedAddr` is declared as `Tint*`, so `(Tint *)listedAddr` casts a pointer to its own type. It is a no-op cast and cannot be an invalid type conversion. The new dangerousTypeCast warning is therefore a false positive. Most likely the PR now keeps the generic template body, or builds the instantiation incorrectly. There `Tint` is not a known primitive type, so the 'same type' guard in the cast check no longer applies. ---- 13 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/g/globus-common/globus-common_18.15.orig.tar.gz Result: your globus_common-18.15/library/globus_thread.c:1679:9: portability: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn] Explanation: `globus_l_thread_impl->thread_cancellable_func` is a function-pointer member whose function returns `void *`, and `globus_thread_cancellable_func()` also returns `void *`. Returning the call result is correct pointer-to-pointer code, not an integer. The PR added a new FUNCTION ValueType and new return-type handling for calls through function pointers. That handling evidently gives this member call (through `->`) a wrong non-pointer type, so CastIntegerToAddressAtReturn now fires. This is a new false positive. ---- 14 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/i/infernal/infernal_1.1.5.orig.tar.gz Result: your infernal-1.1.5/easel/esl_sqio.c:662:3: portability: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn] Explanation: In easel, `get_error` is a struct member declared as a function pointer returning `const char *` (`const char *(*get_error)(const ESL_SQFILE *)`). So `sqfp->get_error(sqfp)` returns a pointer, which matches the function's `const char *` return type, and no integer is returned. The new FUNCTION ValueType handling for calls through function pointers gives the wrong result type when the pointer is reached through a member access (`.`/`->`). That wrong type makes CastIntegerToAddressAtReturn fire, so this is a new false positive. ---- 15 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/i/insighttoolkit5/insighttoolkit5_5.4.7.orig.tar.xz Result: your InsightToolkit-5.4.7/Modules/Core/Common/test/itkShapedImageNeighborhoodRangeGTest.cxx:223:34: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable TImage [valueFlowBailoutIncompleteVar] Explanation: The new message is a debug bailout: valueflow skips a function because 'TImage' is an incomplete variable. 'TImage' is the template parameter of the function template around line 223, so the template parameter is still in tokens that valueflow analyzes. It looks like the PR now keeps or analyzes a generic (uninstantiated) template body, or leaves template-parameter tokens where main did not. The identical code at line 238 is not reported, which suggests inconsistent handling rather than better understanding. A new bailout like this means Cppcheck understands the code worse, and it adds no value for users. ---- 16 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/i/insighttoolkit5/insighttoolkit5_5.4.7.orig.tar.xz Result: your InsightToolkit-5.4.7/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/src/lib/openjp2/openjpeg.c:1068:9: portability: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn] Explanation: `l_codec->opj_get_codec_index` is a function-pointer member of `opj_codec_private_t`, declared in openjpeg's opj_codec.h as `opj_codestream_index_t* (*opj_get_codec_index)(void*)`. Calling it yields a pointer, which matches the function's return type `opj_codestream_index_t *`. So no integer is returned. The PR's new FUNCTION value type and call-return-type inference evidently derives a non-pointer (integer) type for this call, which triggers a new false CastIntegerToAddressAtReturn. The same pattern appears at line 1040 and in other files of this package. ---- 17 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/k/kokkos/kokkos_5.2.2.orig.tar.gz Result: main kokkos-5.2.2/core/src/impl/Kokkos_HostSpace_deepcopy.cpp:107:11: style: Variable 'dst_end' can be declared as pointer to const [constVariablePointer] Explanation: `dst_end` is only compared with `dst_c` and is never written through, so it could be `const char*`. Its type does not depend on the template parameter, so the constVariablePointer warning is a true positive. The PR likely causes this function template to be instantiated by deduction and the generic body to be removed or handled differently, and the warning is lost (the same happens at line 74). Losing a valid style finding is a regression. ---- 18 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/k/kokkos/kokkos_5.2.2.orig.tar.gz Result: main kokkos-5.2.2/core/src/impl/Kokkos_HostSpace_deepcopy.cpp:74:11: style: Variable 'dst_end' can be declared as pointer to const [constVariablePointer] Explanation: `dst_end` is only compared with `dst_c` (`dst_c != dst_end`) and is never written through. It could be `const char*`, so main's constVariablePointer warning is a true positive. Its type does not depend on the template parameter `ExecutionSpace`. The PR now deduces and instantiates the function template. The likely cause is that the generic body is gone or treated as an instantiation that the const-pointer check skips, so a valid style warning is lost. The same warning at line 107 also disappears. ---- 19 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/l/labplot/labplot_2.12.1.orig.tar.xz Result: your labplot-2.12.1/src/3rdparty/liborigin/tree.hh:605:36: warning:inconclusive: Member variable 'tree < Origin :: ProjectNode , std :: allocator < tree_node_ < Origin :: ProjectNode > > >::alloc_' is not assigned a value in 'tree < Origin :: ProjectNode , std :: allocator < tree_node_ < Origin :: ProjectNode > > >::operator='. [operatorEqVarError] Explanation: `alloc_` is a `std::allocator` member of the liborigin `tree` container. `std::allocator` is stateless, and its `propagate_on_container_copy_assignment` is false, so leaving it unchanged in `operator=` is idiomatic and correct. The new operatorEqVarError is therefore a false positive. It appears only because the PR now instantiates this class template differently. The same warning is reported twice, once for `tree` and once for `tree`, which also points to a duplicated, imperfect instantiation of the same type. ---- 20 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/l/labplot/labplot_2.12.1.orig.tar.xz Result: your labplot-2.12.1/src/3rdparty/liborigin/tree.hh:605:36: warning:inconclusive: Member variable 'tree < ProjectNode , std :: allocator < tree_node_ < ProjectNode > > >::alloc_' is not assigned a value in 'tree < ProjectNode , std :: allocator < tree_node_ < ProjectNode > > >::operator='. [operatorEqVarError] Explanation: `tree::operator=` delegates to `copy_()`, which rebuilds the nodes on top of the existing head/feet sentinels. Leaving `alloc_` (a stateless `std::allocator`) untouched is the intended allocator behaviour, so 'not assigned a value' is a false positive. This line also duplicates a second new warning for the same class, once named `tree` and once `tree`. That suggests the PR's new deduction-based instantiation created a second, unqualified instantiation of the same type. The added warning is a noisy duplicate false positive. ---- 21 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/libi/libiio/libiio_0.26.orig.tar.gz Result: your libiio-0.26/context.c:387:3: portability: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn] Explanation: `ctx->ops->clone` is a function pointer member returning `struct iio_context *`, so `return ctx->ops->clone(ctx);` returns a pointer. The warning that it returns an integer is a false positive. It comes from the PR's new ValueType handling of function-pointer declarators (FUNCTION type). The member-access call (`.` operand, no `tok->variable()`) skips the new return-type branch. It falls into the old dereference branch instead, so the call result gets a wrong non-pointer type. ---- 22 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libo/libofx/libofx_0.10.9.orig.tar.gz Result: your libofx-0.10.9/lib/tree.hh:487:36: warning:inconclusive: Member variable 'tree < OfxGenericContainer * , std :: allocator < tree_node_ < OfxGenericContainer * > > >::alloc_' is not assigned a value in 'tree < OfxGenericContainer * , std :: allocator < tree_node_ < OfxGenericContainer * > > >::operator='. [operatorEqVarError] Explanation: `alloc_` is the tree's allocator member, here `std::allocator>`. `std::allocator` is stateless, so a copy-assignment operator that copies only the nodes via `copy_(other)` and leaves `alloc_` alone is correct and idiomatic. Standard containers don't propagate `std::allocator` on copy assignment either. The new inconclusive operatorEqVarError only appears because Cppcheck cannot tell what the allocator type is. The class name in the message is also printed with unusual spaces (`tree < OfxGenericContainer * , ... >`), which points to a template-simplifier side effect of the PR rather than better understanding of the code. This is a new false positive. ---- 23 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/m/maim/maim_5.8.0.orig.tar.gz Result: main maim-5.8.0/src/cxxopts.hpp:1016:34: style: Argument 'value' shadows outer function [shadowFunction] maim-5.8.0/src/cxxopts.hpp:576:3: note: Shadowed function maim-5.8.0/src/cxxopts.hpp:1016:34: note: Shadow argument Explanation: The same shadowFunction warning for parameter 'value' at line 1016 is still reported. Only the 'Shadowed function' note moved from line 576 to line 569. In cxxopts both lines are overloads of the free function template `cxxopts::value` (`value()` and `value(T&)`), so either note location is equally correct. The PR's template handling only changed which overload is picked as the shadowed declaration, which makes no practical difference to users. ---- 24 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/m/miniaudio/miniaudio_0.11.25+dfsg.orig.tar.gz Result: your miniaudio-0.11.25/external/fs/fs.c:1685:9: portability: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn] Explanation: `pBackend->next` is a function-pointer member whose return type is `fs_iterator*`. Calling it returns a pointer, which matches the function's `fs_iterator*` return type, so there is no integer-to-pointer conversion. The PR's new FUNCTION/member-pointer ValueType handling only resolves the return type for calls through a plain variable (`tok->variable()`). It does not cover calls through a struct member (`p->next(...)`), so the call result gets a wrong, non-pointer type. This new CastIntegerToAddressAtReturn warning is a false positive. ---- 25 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/m/mitlm/mitlm_0.4.1.orig.tar.gz Result: main mitlm-0.4.1/src/Lattice.cpp:612:23: style:inconclusive: Function '_Sort' argument 1 names different: declaration 'numTrans' definition 'numArcs'. [funcArgNamesDifferent] mitlm-0.4.1/src/Lattice.h:143:24: note: Function '_Sort' argument 1 names different: declaration 'numTrans' definition 'numArcs'. mitlm-0.4.1/src/Lattice.cpp:612:23: note: Function '_Sort' argument 1 names different: declaration 'numTrans' definition 'numArcs'. Explanation: The same funcArgNamesDifferent warning is still reported, at the same location. Only the function name in the message changed: before it was the template '_Sort', now it is the instantiation '_Sort < mitlm :: ArcCompare >'. The PR now deduces the template argument from a call such as _Sort(n, ArcCompare(...)), so the check runs on the instantiated function. The finding itself is the same: the declaration in Lattice.h names the parameter 'numTrans' and the definition names it 'numArcs'. The new name is arguably slightly less readable for users, since it shows an internal instantiation name, but either way the substance of the warning is unchanged. ---- 26 / 50 ---- Verdict: REGRESSION (low confidence) Package: https://ftp.debian.org/debian/pool/main/m/mrtrix3/mrtrix3_3.0~rc3+git135-g2b8e7d0c2.orig.tar.gz Result: your mrtrix3-3.0~rc3+git135-g2b8e7d0c2/core/formats/mri.cpp:136:49: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable T [valueFlowBailoutIncompleteVar] Explanation: The new message is a debug bailout inside the generic body of `template void write(std::ostream&, T, bool)`. Cppcheck skips the function because the template parameter `T` is unknown in uninstantiated code. Main did not report this, so main most likely instantiated the template and removed the generic definition. With the PR, the generic definition is apparently kept, probably via the new deferred-removal / `hasRemainingCalls` logic for calls whose template arguments could not be deduced. Cppcheck then analyses uninstantiated code with an unknown type `T` and bails out. No real warning is gained. The new bailout only adds noise and shows that template code is left unresolved, so this is a minor regression. Confidence is low because the call sites are not shown. ---- 27 / 50 ---- Verdict: REGRESSION (low 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/lib/sqlite/sqlite3.c:25206:3: portability: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn] Explanation: The source is not available, so this cannot be confirmed. sqlite3.c is C code, so the template changes do not apply. The likely cause is the new ValueType handling: parsedecl now gives function pointer declarators a FUNCTION type, and calls through a function pointer now get the declared return type. SQLite has nested function pointer declarators near these lines, for example the `xDlSym` member in the `sqlite3OsDlSym` style wrappers. A wrapper like that returns a function pointer from a function that returns a function pointer, not an integer. Mis-parsing such a declarator would produce this new CastIntegerToAddressAtReturn, and SQLite does not really return integers from pointer-returning functions. The warning is therefore most likely a new false positive. ---- 28 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/p/pam-wrapper/pam-wrapper_1.1.8.orig.tar.xz Result: your pam-wrapper-1.1.8/src/pam_wrapper.c:486:2: portability: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn] Explanation: `libpam_pam_getenv()` returns the result of calling `pwrap.libpam.symbols._libpam_pam_getenv.f`. That member is a function pointer to the real `pam_getenv`, which returns `const char *`. So the function returns a pointer of exactly its own return type, not an integer. The PR adds new FUNCTION value types and return-type inference for calls through function pointers. Here that inference evidently produced an integer type for a call through a struct/union member function pointer. This yields a new false CastIntegerToAddressAtReturn; the same pattern appears at lines 493 and 580. ---- 29 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/p/pam-wrapper/pam-wrapper_1.1.8.orig.tar.xz Result: your pam-wrapper-1.1.8/src/pam_wrapper.c:493:2: portability: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn] Explanation: `_libpam_pam_getenvlist.f` is a function pointer whose type matches `pam_getenvlist`, so the call returns `char **`, exactly the function's return type. Nothing here returns an integer, so the CastIntegerToAddressAtReturn warning is a false positive. It comes from the PR's new FUNCTION ValueType and the new return-type handling for calls through function pointers. That code gives this call (a function pointer member of a union inside a struct) a wrong, integer-like type. The same new false positive also appears at lines 486 and 580. ---- 30 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/p/postsrsd/postsrsd_2.4.1.orig.tar.gz Result: your roehling-postsrsd-24c678b/src/database.c:334:9: portability: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn] Explanation: `database_read()` returns `db->read(db, key)`. `read` is a function-pointer member that returns `char*` (postsrsd's `struct database` declares `char* (*read)(...)`). So a pointer is returned from a function returning `char*`, and no integer is involved. The new FUNCTION valuetype handling for calls through function pointers gives this call the wrong type, most likely on the member-access path (`db->read`), where the token is `.` rather than the variable. As a result, CastIntegerToAddressAtReturn is now reported. This is a false positive introduced by the PR. ---- 31 / 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: `new_xpath_variable` is only ever called with explicit template arguments, e.g. `new_xpath_variable(name)`. In main the generic template body is removed once the instantiations exist, so it is never analyzed. The PR adds `hasRemainingCalls()`, which keeps a template declaration if any plain call with the same name remains. Here a plausible trigger is calls to the non-template overload `new_xpath_variable(type, name)` elsewhere in the file. If so, the uninstantiated generic body now stays in the token list. ValueFlow then hits `sizeof(T)` with the unknown type `T` and emits a new incomplete-variable bailout. The new debug message shows Cppcheck now analyzes a leftover uninstantiated template, which is worse code understanding. ---- 32 / 50 ---- Verdict: NEUTRAL (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:76:2: style: Struct 'JustType' has a constructor with 1 argument that is not explicit. [noExplicitConstructor] Explanation: Line 76 is a real non-explicit one-argument constructor in the primary `JustType` template, so the warning is a true positive. Removing the generic 'JustType' line does not lose it. The PR now instantiates `JustType` through type deduction (from calls to `just()`), and the same finding at line 76 is reported for the instantiation 'JustType < int >'. Only the class name in the message changed (plus one report per instantiation), which makes no real difference to users. Side note: the companion 'JustType < const char * >' line at 76 looks dubious, since that type should match the `JustType` partial specialization. That concerns a different result, not this removal. ---- 33 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/q/qtdeclarative-opensource-src/qtdeclarative-opensource-src_5.15.19+dfsg.orig.tar.xz Result: your qtdeclarative-everywhere-src-5.15.19/src/qml/compiler/qv4compilercontext_p.h:180:5: 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 Member (line 180), at line 243 and at line 336. The code itself is ordinary: a nested struct inside struct Context, with members of qualified types such as QQmlJS::AST::VariableScope. Main did not report these. The new deduction rounds rebuild or update the symbol database incrementally, and this message shows that some types now stay unresolved. In other words, Cppcheck understands this code worse than before. Nothing in the code changed that would justify the new message. ---- 34 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/r/r-cran-qqconf/r-cran-qqconf_1.3.2+dfsg.orig.tar.xz Result: main qqconf/src/jointlevel_fft_twosided.cpp:265:28: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable T [valueFlowBailoutIncompleteVar] Explanation: `copy_zero_padded` is only ever called as `copy_zero_padded(input_a, r2c_in, size, padded_size)`, with a `const double*` and a `double*` argument. Before the PR, a template called without literal arguments was never instantiated. The generic body was analysed with `T` unknown, which caused the incompleteVar bailout. With the PR, the parameter forms `const T*` and `T*` both deduce `T=double`. The template is instantiated as `copy_zero_padded` and the generic definition is removed. So the bailout disappears because Cppcheck now analyses the real instantiated code, and no new warnings appear. ---- 35 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/r/regina-normal/regina-normal_7.4.1.orig.tar.gz Result: your regina-7.4.1/engine/testsuite/surface/normalsurfaces.cpp:129:19: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable individualStd [valueFlowBailoutIncompleteVar] Explanation: `individualStd` is a non-type `bool` template parameter of `compareCompactProfiles`. The new bailout says Cppcheck now analyses the generic, uninstantiated template body, where `individualStd` is an unknown name. A likely cause is the PR's new 'keep the generic definition while undeduced calls remain' logic. The parameters are alias templates (`ExpectProfiles<...>`), which deduction does not support, so the plain calls can never be deduced and the template stays. Analysing the raw template only brings bailouts and noise. The same diff adds a false positive here: an `invalidContainer` warning at line 143. `std::back_inserter` holds a pointer to the container, which `reserve()` does not invalidate. A new bailout showing worse understanding of the code is a regression. ---- 36 / 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 whose body, `((double)d)*d`, uses no members. It really can be static, so the warning is a true positive. Before this PR, calls like `sq(x)` without explicit template arguments were never instantiated, so the check never saw the function. Now the argument type is deduced and `SGT::sq` is instantiated and checked. The instantiated name in the message is a little verbose, but the finding is valid. ---- 37 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/s/seadrive-fuse/seadrive-fuse_3.0.23.orig.tar.gz Result: your haiwen-seadrive-fuse-d900dd0/src/block-mgr.c:144:5: portability: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn] Explanation: Line 144 returns the result of calling `mgr->backend->stat_block(...)`. This is a struct member function pointer that returns `BlockMetadata *`, so the function really returns a pointer and no integer is involved. The PR changed how pointer-to-function declarations and calls through them get their ValueType. That change evidently gives this call through the member function pointer an integer type. The new CastIntegerToAddressAtReturn is therefore a false positive, and lines 151 and 67 show the same pattern. ---- 38 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/s/seadrive-fuse/seadrive-fuse_3.0.23.orig.tar.gz Result: your haiwen-seadrive-fuse-d900dd0/src/block-mgr.c:151:5: portability: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn] Explanation: The function returns the result of a call through the struct member function pointer `mgr->backend->stat_block_by_handle`, which is declared to return `BlockMetadata *`. The pointer return type is passed straight through, so no integer is returned. The PR's new FUNCTION ValueType handling only derives the return type when the callee token is a plain variable. For a member access (`->`) it falls back to stripping one pointer level, which leaves a non-pointer FUNCTION type. Check64BitPortability then misreads that as an integer. This is a new false positive. ---- 39 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/s/seadrive-fuse/seadrive-fuse_3.0.23.orig.tar.gz Result: your haiwen-seadrive-fuse-d900dd0/src/block-mgr.c:67:5: portability: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn] Explanation: `open_block` is a function-pointer member of the backend struct and returns `BlockHandle *`. The function `seaf_block_manager_open_block` also returns `BlockHandle *`, so the types match and no integer is returned. The new warning is a false positive. It comes from the PR's new handling of calls through function pointers: it derives the call's return type from the declarator and gets this one wrong, treating it as an integer instead of a pointer. ---- 40 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/s/sentencepiece/sentencepiece_0.2.2.orig.tar.gz Result: your sentencepiece-0.2.2/third_party/protobuf-lite/message_lite.cc:171:30: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable aliasing [valueFlowBailoutIncompleteVar] Explanation: The new debug message points at `aliasing` (column 30) in the template `MergeFromImpl(BoundedZCIS, ...)`. In a correct instantiation, `aliasing` is replaced by `true` or `false`. The bailout means ValueFlow is now analysing a copy where `aliasing` is still an unresolved, incomplete name. The likely cause is the PR's new deferred-removal / remaining-calls logic, which can keep the generic template body or produce an incompletely substituted copy. Only this overload is affected, not the two similar ones. A new incomplete-variable bailout means Cppcheck understands this code worse, and the function is now skipped by valueFlowConditionExpressions. ---- 41 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/t/tarantool/tarantool_2.6.0.orig.tar.gz Result: your tarantool_2.6.0/src/box/tuple.h:479:2: portability: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn] Explanation: `format->vtab.tuple_chunk_new` is a function-pointer member of the vtab. It returns `const char *`, which matches the return type of `tuple_chunk_new()`. No integer is returned, so the CastIntegerToAddressAtReturn warning is a false positive. The PR's new FUNCTION valuetype handling for calls through function pointers infers the return type wrongly when the callee is a member access (`a->b.c(...)`). The other new warnings in this package (engine.h, index.h, port.h, ...) all come from the same vtab-style call pattern. ---- 42 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/t/texworks/texworks_0.6.11+ds.orig.tar.gz Result: your texworks-release-0.6.11/modules/synctex/synctex_parser.c:3823:5: portability: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn] Explanation: The returned expression is a ternary. One branch calls the function pointer `node->class_->abstract(node)`, which returns `char *`. The other branch is the string literal "none". Neither branch is an integer, so the new CastIntegerToAddressAtReturn warning is a false positive. It most likely comes from the PR's new FUNCTION/MEMBER_POINTER ValueType handling giving the call through the struct-member function pointer a wrong, integer-like type. ---- 43 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/t/timescaledb/timescaledb_2.31.0+dfsg.orig.tar.xz Result: your timescale-timescaledb-4fa2a7c/src/net/conn.c:151:3: portability: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn] Explanation: `conn->ops->errmsg` is a function pointer that returns `const char *`, so returning the result of the call is correct and the new warning is a false positive. The PR adds a FUNCTION ValueType for function-pointer declarators. Its new return-type branch only handles a call through a plain variable (`tok->variable()`), not a member access like `conn->ops->errmsg(...)`. Such a call falls through to the old branch, which just drops one pointer level. The call expression therefore gets a wrong non-pointer FUNCTION type, which CastIntegerToAddressAtReturn treats as an integer being returned. ---- 44 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/t/torcs/torcs_1.3.7+dfsg.orig.tar.xz Result: your torcs-1.3.7+dfsg/src/libs/tgf/directory.cpp:46:3: portability: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn] Explanation: `GfOs.dirGetList` is a function-pointer member that returns `tFList *`, so `return GfOs.dirGetList(dir);` returns a pointer, not an integer. The PR adds a new FUNCTION ValueType for parenthesized function declarators. Its special case that gives a call the function's return type only applies when the callee token is a variable. Here the callee is reached through the `.` member access, so that case does not apply. The call expression therefore seems to get a wrong (non-pointer) ValueType, and CastIntegerToAddressAtReturn fires. This is a new false positive. ---- 45 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/v/voro++/voro++_0.5+revert-to-0.4.6+dfsg1.orig.tar.gz Result: main voro++-0.4.6/src/wall.cc:106:17: style:inconclusive: Technically the member function 'voro::wall_cone::cut_cell_base' can be const. [functionConst] voro++-0.4.6/src/wall.hh:109:8: note: Technically the member function 'voro::wall_cone::cut_cell_base' can be const. voro++-0.4.6/src/wall.cc:106:17: note: Technically the member function 'voro::wall_cone::cut_cell_base' can be const. Explanation: wall_cone::cut_cell_base only reads members (xc, xa, asi, sang, cang, w_id) and calls c.nplane on its parameter, so 'can be const' is a true positive. The PR does not lose it. The removed warning for the generic template is replaced by two equivalent warnings, one per instantiation (voronoicell and voronoicell_neighbor), at the same location. The finding is the same; only the wording changed, with a slightly noisier per-instantiation duplicate. ---- 46 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/w/warzone2100/warzone2100_4.7.0.orig.tar.xz Result: your warzone2100/3rdparty/SQLiteCpp/sqlite3/sqlite3.c:29820:3: portability: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn] Explanation: `xMutexAlloc` is a function pointer declared as `sqlite3_mutex *(*xMutexAlloc)(int)`, so the call returns a `sqlite3_mutex*` and the return statement is pointer-to-pointer. The PR adds new FUNCTION value types and derives the return type of a call through a function pointer by parsing the declaration up to the parenthesized declarator. Here that evidently produced an integer type without the pointer level. Cppcheck therefore reports a false CastIntegerToAddressAtReturn. The same spurious warning appears at line 29829 and at other new sqlite/zstd locations. ---- 47 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/w/woof-doom/woof-doom_16.0.0+dfsg.orig.tar.xz Result: your woof-woof_16.0.0/src/i_oalmusic.c:661:9: portability: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn] Explanation: `active_module->I_MusicFormat()` calls a function-pointer member that returns `const char *`, and the enclosing function also returns `const char *`. No integer is returned, so the new CastIntegerToAddressAtReturn warning is a false positive. It most likely comes from the PR's new FUNCTION ValueType handling for calls through function pointers. When the callee is a struct member reached via `->`, the call seems to get the wrong return type, so the call result is treated as an integer. ---- 48 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/x/xmlroff/xmlroff_0.6.2.orig.tar.gz Result: your xmlroff-0.6.2/libfo/fo/fo-block-fo.c:318:3: portability: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn] Explanation: The function returns the result of a call through an interface function pointer, `iface->get_border_start_width(fo)`. That member is declared as a pointer to a function returning `FoProperty*`, so a pointer is returned and no integer is involved. The PR adds a FUNCTION value type for function pointers. Its new return-type handling only covers plain variables (it requires `tok->variable()`), so member access through `.`/`->` falls back to the old path. That path drops one pointer level and leaves a non-pointer FUNCTION type on the call, which the check then treats as an integer. The new warnings are false positives, and the same pattern produces dozens of them in this package. ---- 49 / 50 ---- Verdict: UNCLEAR (low confidence) Package: https://ftp.debian.org/debian/pool/main/x/xsimd/xsimd_14.3.0.orig.tar.gz Result: main xtensor-stack-xsimd-4643817/test/test_shuffle.cpp:258:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable activate_above_below_checks [valueFlowBailoutIncompleteVar] Explanation: The removed line is a valueFlowBailoutIncompleteVar debug message for `activate_above_below_checks` inside `slide_test::slide_right()`. That name is most likely a member of the class template `slide_test`, so calling it an incomplete variable was a weakness in main. The PR moves `createSymbolDatabaseIncompleteVars` into `finalize()`, after the new template-deduction rounds, and changes varid and template handling. That could mean the member is now resolved, which would be an improvement. It could equally mean the function body is no longer analysed, or no longer instantiated in the same way. The same message also disappears at line 218. Without the declaration of `activate_above_below_checks` or the instantiation details, the cause cannot be confirmed. ---- 50 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/z/zdbsp/zdbsp_1.19+20181027+dfsg.1.orig.tar.xz Result: main zdbsp-1.19+20181027+dfsg.1/blockmapbuilder.cpp:175:37: style: The scope of the variable 'endblock' can be reduced. [variableScope] Explanation: In BuildBlockmap, `block` and `endblock` are declared at function scope, but the shown code does not include their uses. In the upstream zdbsp/ZDoom blockmap code they are only assigned and used inside the per-line `for` loop body (e.g. `block = &BlockLists[...]; endblock = &BlockLists[...];`). If that holds here, their scope can indeed be reduced to the loop body, so the variableScope warnings are true positives. The PR does nothing to the variableScope check itself. The likely cause is its template-instantiation and symbol-database changes (for example, deducing calls like `Push` on `TArray`), which changed how these uses are seen and lost a valid style warning.