AI review of 2026-11-13_22-15-08-a2b79ccde225-results.txt PR: #8996 https://github.com/cppcheck-opensource/cppcheck/pull/8996 Tested: a2b79ccde2256936c14d192c47a690fb02a51844 Merge base: 275e673c62902ac61e79d4151ced6a4882e50707 Reviewed: 2026-11-15 01:40:57 UTC Model: claude-opus-5-5 (effort high) Results: 50 reviewed of 220 in the report (random sample), 3 not reviewed: valueFlowMaxIterations Verdicts: 2 acceptable regression, 27 improvement, 2 neutral, 18 regression, 1 unclear Tokens: 105887 input, 117480 cache read, 29370 cache write, 43797 output The verdicts are written by AI and can be wrong. ---- 1 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/a/adun.app/adun.app_0.81.orig.tar.gz Result: your Adun-0.81/Kernel/Base/AdFourierTorsion.c:222:35: style: Parameter 'interaction' can be declared as pointer to const [constParameterPointer] Explanation: `interaction` is an input array. In the visible code it is only read, to decode atom indices and constants into locals (`interaction[0..6]`). The PR stops treating compound assignments with indirection as writes through the pointer, which previously made Cppcheck miss this const candidate. Nothing shown writes through `interaction`, so `const double *interaction` looks valid. The same pattern also appears in AdHarmonicImproperTorsion.c. Confidence is medium because the rest of the function body is not shown. ---- 2 / 50 ---- Verdict: REGRESSION (low confidence) Package: https://ftp.debian.org/debian/pool/main/a/apngasm/apngasm_2.91.orig.tar.gz Result: your apngasm-2.91/zlib/deflate1.c:1174:21: style: Variable 'strend' can be declared as pointer to const [constVariablePointer] Explanation: In the non-UNALIGNED_OK path of zlib's longest_match, `strend` is only read (`scan < strend`, `strend - scan`). However, it is also used in `scan = strend - MAX_MATCH;`, where `scan` is a non-const `Bytef*`. If `strend` alone became `const Bytef*`, that assignment would discard the qualifier: an error in C++ and a diagnostic in C. The suggestion only holds if `scan` is also made const, and the diff gives no sign that `scan` is flagged. The warning newly appears because the PR stopped treating compound assignments through pointers (e.g. `scan += 2`) as modifications. That looks like it lost track of the pointer value flowing into a non-const pointer, so this is most likely a new false positive. ---- 3 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/c/chemps2/chemps2_1.8.12.orig.tar.gz Result: your CheMPS2-1.8.12/CheMPS2/Sobject.cpp:389:46: style: Variable 'Block' can be declared as pointer to const [constVariablePointer] Explanation: `Block` is only read: `Block[l + dimL * r]` appears on the right-hand side of a `+=` that writes to `mem`. The pointed-to data is never modified, so `Block` can be declared `const double *`, and the new constVariablePointer warning is a true positive. Before the PR, `isVariableChanged` treated any operand of a compound assignment as possibly changed at indirect level 1. That made Cppcheck miss this. The PR limits that check to plain `=` (or indirect 0), so the warning now appears. ---- 4 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/e/exim4/exim4_4.100.1.orig.tar.xz Result: main exim-4.100.1/exim_monitor/em_menu.c:496:25: warning: Uninitialized variable: y [uninitvar] exim-4.100.1/exim_monitor/em_menu.c:483:23: note: Assuming condition is false exim-4.100.1/exim_monitor/em_menu.c:496:25: note: Uninitialized variable: y Explanation: `y` is passed by address through `get_pos_args[1].value = (XtArgVal)(&y)` and then filled in by `XtGetValues(dialog_ref_widget, get_pos_args, 2)` before line 496. Cppcheck does not follow the address through the global arg array and the X library call, so `y` is initialized at line 496 and this warning was a false positive. Removing it is good for users. The same PR adds an equally false warning at line 489 for the `y += yy` path, but that is a separate result. ---- 5 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/f/firebird4.0/firebird4.0_4.0.7.3271.ds6.orig.tar.xz Result: your Firebird-4.0.7.3271-0/src/intl/kanji.cpp:450:18: style: Condition '*euc_len>euc_buf_len' is always false [knownConditionTrueFalse] Firebird-4.0.7.3271-0/src/intl/kanji.cpp:421:16: note: Assuming that condition '*euc_len>=euc_buf_len' is not redundant Firebird-4.0.7.3271-0/src/intl/kanji.cpp:424:17: note: Assuming condition is true Firebird-4.0.7.3271-0/src/intl/kanji.cpp:430:8: note: Assuming condition is false Firebird-4.0.7.3271-0/src/intl/kanji.cpp:447:13: note: Assuming condition is true Firebird-4.0.7.3271-0/src/intl/kanji.cpp:450:18: note: Condition '*euc_len>euc_buf_len' is always false Explanation: At line 421 the loop returns when `*euc_len >= euc_buf_len`, so afterwards `*euc_len < euc_buf_len`. Line 449 then does `*euc_len += 2`. If `*euc_len` was `euc_buf_len - 1`, the check `*euc_len > euc_buf_len` at line 450 is true, so the condition is not always false. Cppcheck apparently no longer sees the compound assignment through the pointer as changing the value, which is consistent with the new `indirect == 0 || "="` restriction in isVariableChanged. This is a new false positive. ---- 6 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/f/freeimage/freeimage_4.2.1+ds.orig.tar.xz Result: your freeimage-4.2.1+ds/Source/FreeImage/NNQuantizer.cpp:299:11: style: Variable 'q' can be declared as pointer to const [constVariablePointer] Explanation: In alterneigh, 'q' is set to radpower and then only advanced and dereferenced for reading (a = *(++q)). Nothing is ever written through q, so it can be declared 'const int *q'. The new constVariablePointer warning is a true positive. The PR stops treating compound assignments through other pointers as modifying the pointee, which is what now lets Cppcheck report it. ---- 7 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/f/freeimage/freeimage_4.2.1+ds.orig.tar.xz Result: your freeimage-4.2.1+ds/Source/FreeImageToolkit/ClassicRotate.cpp:360:16: style: Variable 'nrow' can be declared as pointer to const [constVariablePointer] Explanation: `nrow` initializes the non-const pointer `dbits` (`uint8_t *dbits = nrow - z * dst_pitch`), and `dbits` is written through with `*dbits |= bitpos`. If `nrow` were `const uint8_t *`, that initialization would not compile, so the new constVariablePointer warning is a false positive. The PR's added condition `indirect == 0 || str() == "="` appears to make Cppcheck stop treating a compound assignment through a dereferenced pointer as a write. As a result it misses that the pointee is modified. ---- 8 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/f/freetype/freetype_2.14.3+dfsg.orig.tar.xz Result: main freetype-2.14.3/src/gzip/inflate.c:1424:10: style: Variable 'state->flags' is assigned an expression that holds the same value. [redundantAssignment] freetype-2.14.3/src/gzip/inflate.c:1420:11: note: flags is assigned 'state->flags' here. freetype-2.14.3/src/gzip/inflate.c:1424:10: note: Variable 'state->flags' is assigned an expression that holds the same value. Explanation: The removed warning was a false positive. `flags` is saved from `state->flags`, then `inflateReset(strm)` runs. In zlib, `inflateReset` goes through `inflateResetKeep`, which resets `state->flags` to -1 via `strm->state`. Writing `state->flags = flags` afterwards therefore restores the saved value and is not redundant. ---- 9 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/g/gdb/gdb_18.1.orig.tar.xz Result: your gdb-18.1/bfd/coff-tic54x.c:116:18: style: Parameter 'ATTRIBUTE_UNUSED' can be declared as pointer to const. However it seems that 'tic54x_relocation' is a callback function, if 'ATTRIBUTE_UNUSED' is declared with const you might also need to cast function pointer(s). [constParameterCallback] gdb-18.1/bfd/coff-tic54x.c:192:5: note: You might need to cast the function pointer here gdb-18.1/bfd/coff-tic54x.c:116:18: note: Parameter 'ATTRIBUTE_UNUSED' can be declared as pointer to const Explanation: The new warning names a parameter 'ATTRIBUTE_UNUSED'. That is an unexpanded attribute macro, not a real parameter; the actual parameter is `void *data`. It is unused, and its type is fixed by the reloc_howto_type special_function pointer signature used in the HOWTO table. Changing it to const would break the function pointer type, so the suggestion is not actionable. The message also points at a bogus name. The same burst of 'ATTRIBUTE_UNUSED' warnings appears across many bfd files, which suggests the PR changed how these misparsed parameters are treated rather than finding real issues. This is new noise for users. ---- 10 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/g/gdb/gdb_18.1.orig.tar.xz Result: your gdb-18.1/opcodes/m32c-asm.c:822:56: style: Parameter 'ATTRIBUTE_UNUSED' can be declared as pointer to const [constParameterPointer] Explanation: In `parse_size`, `*strp += 2` writes through `strp`, so `strp` (`const char **`) cannot become pointer-to-const. The other parameters are not plain pointers that could take this suggestion either. The new warning also names the macro 'ATTRIBUTE_UNUSED' as the parameter, which shows Cppcheck misread the parameter list. This fits the PR's change: compound assignments with `indirect != 0` are no longer treated as modifications in `isVariableChanged`, so the write through `*strp` is missed. The many similar new 'ATTRIBUTE_UNUSED' const-parameter warnings across bfd point to the same problem. This is a new false positive. ---- 11 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/g/gretl/gretl_2026d.orig.tar.xz Result: your gretl-2026d/plugin/regls.c:806:37: style: Parameter 'x' can be declared as pointer to const [constParameterPointer] Explanation: `ccd_scale` writes into the matrix's data: `xj = x->val + j*n; xj[i] *= v;` scales every column of `x` in place. In C, `const gretl_matrix *x` would still compile, because only the `val` pointer member becomes const, not the data it points to. But suggesting const here is misleading, since the function's purpose is to modify the matrix contents. Main did not warn, which is Cppcheck's usual behaviour when data is written through a member pointer. The PR changed how compound assignments are handled for indirect writes, so `xj[i] *= v` is apparently no longer seen as a write through the alias. A plain `xj[i] = v` would presumably still suppress the warning. This new warning is a side effect of that change, so it is a new false positive. ---- 12 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/g/grok/grok_1.20110708.1.orig.tar.gz Result: main grok-1.20110708.1/grok_discover.c:226:3: error: Uninitialized variable: score [legacyUninitvar] Explanation: `score` is declared without an initializer and then read by the compound assignment `score += ...`, so the uninitialized-variable warning is a true positive. Before the PR, only the legacy checker (legacyUninitvar) reported it. With the PR, valueflow understands that a compound assignment reads the variable, so the modern uninitvar check now reports it. This is the same true positive coming from the better valueflow analysis, matching the new test case `x += i;`. The legacy duplicate is gone, so the report is effectively the same warning with a more accurate source. ---- 13 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/g/grok/grok_1.20110708.1.orig.tar.gz Result: your grok-1.20110708.1/grok_discover.c:226:3: error: Uninitialized variable: score [uninitvar] Explanation: `score` is declared without an initializer and then used in `score += ...` at line 226, so it really is read uninitialized. Main already flagged this through the legacy checker (legacyUninitvar). With the PR, the valueflow-based uninitvar check now treats compound assignment as a read and reports it. Same true positive, now from the more accurate valueflow check, which matches the PR's new test. ---- 14 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/h/hwloc/hwloc_2.15.0.orig.tar.bz2 Result: your hwloc-2.15.0/hwloc/topology-xml-nolibxml.c:591:7: error: If memory allocation fails: pointer addition with NULL pointer. [nullPointerArithmeticOutOfMemory] hwloc-2.15.0/hwloc/topology-xml-nolibxml.c:586:19: note: Assuming allocation function fails hwloc-2.15.0/hwloc/topology-xml-nolibxml.c:586:19: note: Assignment 'escaped=malloc(fulllen*6+1)', assigned value is 0 hwloc-2.15.0/hwloc/topology-xml-nolibxml.c:587:7: note: dst is assigned 'escaped' here. hwloc-2.15.0/hwloc/topology-xml-nolibxml.c:591:7: note: Null pointer addition Explanation: `escaped = malloc(...)` is never checked for NULL. `dst = escaped;` is followed by `dst += sublen;`, so if the allocation fails this is pointer arithmetic on a NULL pointer. Before the PR, the compound assignment `+=` was treated as a plain write that discarded the tracked null value, so main stayed silent. The PR now treats `+=` as a read-modify-write, which matches the updated test in testnullpointer.cpp. The new nullPointerArithmeticOutOfMemory warning is a genuine true positive for unchecked malloc, so this is an improvement. ---- 15 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/j/jami/jami_20231201.0~ds2.orig.tar.gz Result: your jami-20231201.0/daemon/src/client/videomanager.cpp:172:18: style: Variable 'cIn' can be declared as pointer to const [constVariablePointer] Explanation: `cIn` is only used as `cIn[s]` on the right-hand side of `c[s] += cIn[s];`. The data it points to is never modified, so it can be declared as `const float*`. Before this PR, `isVariableChanged` treated any operand of a compound assignment as possibly changed, even the right-hand side, which suppressed this warning. The PR restricts that check for indirect access to plain `=`, so the warning now appears. It is a true positive. ---- 16 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/k/kmscon/kmscon_10.0.4.orig.tar.gz Result: your kmscon-10.0.4/src/video/drm_shared.c:1467:9: error: Uninitialized variable: disp->flags [uninitvar] Explanation: `disp` is the iterator of `dlist_for_each_entry`. On each pass it points to an existing display object in `video->displays`, and that object's `flags` were initialised when the display was created. `disp->flags &= ~DISPLAY_AVAILABLE` therefore reads an initialised field, so the uninitvar warning is a false positive. The PR changes how compound assignments are handled with indirection, which appears to let a bogus uninit value reach this list-iterator access. ---- 17 / 50 ---- Verdict: UNCLEAR (low confidence) Package: https://ftp.debian.org/debian/pool/main/k/knot-resolver/knot-resolver_6.5.0.orig.tar.xz Result: your knot-resolver-6.5.0/daemon/io.c:139:35: style: Parameter 'sess_data' can be declared as pointer to const. However it seems that 'pl_udp_event_wrap' is a callback function, if 'sess_data' is declared with const you might also need to cast function pointer(s). [constParameterCallback] knot-resolver-6.5.0/daemon/io.c:187:17: note: You might need to cast the function pointer here knot-resolver-6.5.0/daemon/io.c:139:35: note: Parameter 'sess_data' can be declared as pointer to const Explanation: `sess_data` is never used in `pl_udp_event_wrap`. The function body only increments counters through `the_worker` with `+= 1`. Strictly speaking, the parameter could be `const void *`, and the warning does mention that the callback signature would need a cast. However, the PR only changes how compound assignments through indirection are treated, and nothing in this function touches `session` or `sess_data` that way. It is not clear why the warning appears now. Cppcheck normally does not flag unused parameters, and flagging unused parameters of a fixed-signature callback is mostly noise. The shown code is not enough to tell whether this is a legitimate new finding or an unintended side effect. ---- 18 / 50 ---- Verdict: REGRESSION (low confidence) Package: https://ftp.debian.org/debian/pool/main/k/knot/knot_3.5.8.orig.tar.xz Result: your knot-3.5.8/src/knot/dnssec/zone-sign.c:572:57: style: Parameter 'data' can be declared as pointer to const. However it seems that 'set_signed' is a callback function, if 'data' is declared with const you might also need to cast function pointer(s). [constParameterCallback] knot-3.5.8/src/knot/dnssec/zone-sign.c:1048:53: note: You might need to cast the function pointer here knot-3.5.8/src/knot/dnssec/zone-sign.c:572:57: note: Parameter 'data' can be declared as pointer to const Explanation: `set_signed` is a callback for `zone_tree_apply`. Its `void *data` parameter is deliberately marked `_unused_`. It is never touched, so declaring it `const` is technically possible. However, Cppcheck intentionally skips the const-pointer warning for parameters marked `__attribute__((unused))` (see the existing test in testother). Suggesting a const change for an unused callback parameter, which would need a function-pointer cast, is noise rather than a useful finding. The PR only changes how compound assignments count as variable changes, which has no clear link to this unused parameter. The new warning therefore looks like an unintended side effect that adds a low-value or false-positive report. It is not clear why main did not report it, hence low confidence. ---- 19 / 50 ---- Verdict: IMPROVEMENT (low confidence) Package: https://ftp.debian.org/debian/pool/main/k/krb5/krb5_1.22.1.orig.tar.gz Result: your krb5-1.22.1/src/plugins/authdata/greet_client/greet.c:259:18: style: Parameter 'plugin_context' can be declared as pointer to const. However it seems that 'greet_size' is a callback function, if 'plugin_context' is declared with const you might also need to cast function pointer(s). [constParameterCallback] krb5-1.22.1/src/plugins/authdata/greet_client/greet.c:373:5: note: You might need to cast the function pointer here krb5-1.22.1/src/plugins/authdata/greet_client/greet.c:259:18: note: Parameter 'plugin_context' can be declared as pointer to const Explanation: In greet_size, 'plugin_context' is never used, so declaring it 'const void *' would be valid. Because greet_size is used as a callback (line 373), Cppcheck correctly uses the constParameterCallback form, which warns that the function pointer may need a cast. The PR stops treating compound assignments through a pointer (here '*sizep += ...') as plain assignments. That change appears to unblock the analysis for this function; the same pattern produces the new findings in ai_authdata.c and pac.c. The finding is technically correct, but its value is low because the plugin interface fixes the signature. Cppcheck also does not report the equally unused parameter in greet_delete_attribute, so the exact mechanism is unclear, which keeps confidence low. ---- 20 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/k/krb5/krb5_1.22.1.orig.tar.gz Result: your krb5-1.22.1/src/plugins/kdb/db2/libdb2/mpool/mpool.c:267:18: style: Parameter 'mp' can be declared as pointer to const [constParameterPointer] Explanation: In `mpool_put`, `mp` is only used in `++mp->pageput` inside `#ifdef STATISTICS`. Without STATISTICS, `mp` is unused, and Cppcheck does not report constParameterPointer for unused pointer parameters (the existing test `void h(int *p) {}` expects no warning). So this new warning most likely comes from the STATISTICS configuration. There, `++mp->pageput` writes through `mp`, so `mp` cannot be pointer to const. The PR apparently made Cppcheck miss this write through the pointer, which makes the new warning a false positive. ---- 21 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/l/linuxcnc/linuxcnc_2.9.9.orig.tar.gz Result: your linuxcnc-2.9.9/src/hal/drivers/mesa-hostmot2/hm2_pci.c:215:16: style: Variable 'board' can be declared as pointer to const [constVariablePointer] Explanation: In hm2_pci_read, 'board' is only read, in `void *src = board->base + addr;`. Declaring it `const hm2_pci_t *` keeps that line valid: the member becomes `void * const`, and its value can still be copied into the non-const `src`. Nothing is written through 'board', so it can be pointer to const. Before, the compound assignments to the derived pointers (`src += 4`, `buffer += 4`) were apparently wrongly treated as modifying data pointed to. The PR stops counting compound assignment as a write when indirect > 0. The new warning is a true positive and matches the pattern of the new test in testother.cpp. ---- 22 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/l/liquid-dsp/liquid-dsp_1.8.3.orig.tar.xz Result: your liquid-dsp-1.8.3/src/framing/tests/bpacketsync_autotest.c:28:59: style: Parameter '_payload' can be declared as pointer to const. However it seems that 'bpacketsync_autotest_callback' is a callback function, if '_payload' is declared with const you might also need to cast function pointer(s). [constParameterCallback] liquid-dsp-1.8.3/src/framing/tests/bpacketsync_autotest.c:66:44: note: You might need to cast the function pointer here liquid-dsp-1.8.3/src/framing/tests/bpacketsync_autotest.c:28:59: note: Parameter '_payload' can be declared as pointer to const Explanation: `bpacketsync_autotest_callback` never uses `_payload`: the body only checks `_payload_valid` and increments the counter through `_userdata`. So `_payload` could be declared as pointer to const. Cppcheck normally reports unused pointer parameters this way (the existing test for `void h(int *p) {}` expects a warning). The constParameterCallback wording already notes that the function is passed as a callback at line 66 and that a cast might be needed. The new warning is technically a true positive that main missed, matching the similar new findings in the other bench files. It is unclear from the diff exactly why main missed it, so confidence is medium. ---- 23 / 50 ---- Verdict: ACCEPTABLE REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libg/libg3d/libg3d_0.0.8.orig.tar.gz Result: main libg3d-0.0.8/plugins/import/imp_3ds/imp_3ds_callbacks.c:699:15: style: Variable 'material' can be declared as pointer to const [constVariablePointer] Explanation: In x3ds_cb_0xA354, 'material' is only read: it is null-checked and its 'tex_image' member is copied into 'image'. Writes go through 'image' (a separate G3DImage*), and the struct 'material' points to is never modified. Declaring it 'const G3DMaterial *' would compile fine, so the constVariablePointer warning was a true positive. The PR's change to how compound assignments are treated (likely 'parent->nb -= 4') made Cppcheck drop it, which is a new false negative. ---- 24 / 50 ---- Verdict: ACCEPTABLE REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libg/libg3d/libg3d_0.0.8.orig.tar.gz Result: main libg3d-0.0.8/plugins/import/imp_3ds/imp_3ds_callbacks.c:723:15: style: Variable 'material' can be declared as pointer to const [constVariablePointer] Explanation: In x3ds_cb_0xA356, 'material' is only read: it is null-checked and its 'tex_image' member is copied into 'image'. Writes then go through 'image', not 'material'. Declaring it 'const G3DMaterial *' would still compile, because 'material->tex_image' would be 'G3DImage * const' and can still be assigned to 'G3DImage *image'. So the constVariablePointer warning was a true positive, and its removal is a new false negative. ---- 25 / 50 ---- Verdict: REGRESSION (low confidence) Package: https://ftp.debian.org/debian/pool/main/libg/libg3d/libg3d_0.0.8.orig.tar.gz Result: your libg3d-0.0.8/plugins/import/imp_3ds/imp_3ds_callbacks.c:630:43: style: Parameter 'global' can be declared as pointer to const [constParameterPointer] Explanation: In `x3ds_cb_0xA081`, `global` is never used. The function is one of a family of 3DS chunk callbacks that all share the signature `(x3ds_global_data *global, x3ds_parent_data *parent)`. Other callbacks in the family, such as `0xA300`, do modify through `global` (`++global->max_tex_id`). These are most likely called through a function-pointer table, so making `global` const in this one callback would break the shared signature. The suggestion is therefore not actionable, and the warning is effectively a false positive. Its appearance is also suspicious: the PR only changes how compound assignments are treated, and this function only does `material->flags |= ...`, which does not involve `global`. The new warning looks like a side effect rather than better understanding of the code. The removals of the `material` warnings at lines 699 and 723 are good, but this added line is a likely false positive. ---- 26 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/libl/liblivemedia/liblivemedia_2026.11.08.orig.tar.gz Result: your live/liveMedia/RTPSink.cpp:350:27: style: The comparison 'fTotalOctetCount_lo < prevTotalOctetCount_lo' is always false because 'fTotalOctetCount_lo' and 'prevTotalOctetCount_lo' represent the same value. [knownConditionTrueFalse] live/liveMedia/RTPSink.cpp:348:38: note: 'prevTotalOctetCount_lo' is assigned value 'fTotalOctetCount_lo' here. live/liveMedia/RTPSink.cpp:350:27: note: The comparison 'fTotalOctetCount_lo < prevTotalOctetCount_lo' is always false because 'fTotalOctetCount_lo' and 'prevTotalOctetCount_lo' represent the same value. Explanation: The code saves `prevTotalOctetCount_lo = fTotalOctetCount_lo` and then modifies `fTotalOctetCount_lo += octetCountDiff;` before the comparison. The two values are no longer the same, so `fTotalOctetCount_lo < prevTotalOctetCount_lo` is a real wrap-around check that can be true. The PR changed `isVariableChanged` so that compound assignments are not treated as modifications when `indirect != 0`. As a result, the symbolic value 'prev == fTotal' is no longer invalidated by the `+=`. This new warning is a false positive. ---- 27 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/libl/liblivemedia/liblivemedia_2026.11.08.orig.tar.gz Result: your live/liveMedia/RTPSink.cpp:359:28: style: The comparison 'fTotalPacketCount_lo < prevTotalPacketCount_lo' is always false because 'fTotalPacketCount_lo' and 'prevTotalPacketCount_lo' represent the same value. [knownConditionTrueFalse] live/liveMedia/RTPSink.cpp:357:39: note: 'prevTotalPacketCount_lo' is assigned value 'fTotalPacketCount_lo' here. live/liveMedia/RTPSink.cpp:359:28: note: The comparison 'fTotalPacketCount_lo < prevTotalPacketCount_lo' is always false because 'fTotalPacketCount_lo' and 'prevTotalPacketCount_lo' represent the same value. Explanation: The code saves fTotalPacketCount_lo into prevTotalPacketCount_lo, then changes fTotalPacketCount_lo with `+= packetCountDiff`, then compares the two to detect wrap-around. The values are no longer the same after the compound assignment, so the comparison is not always false. The PR changed isVariableChanged so that, with indirect != 0, a compound assignment like `+=` is no longer treated as a modification. The symbolic 'same value' relation therefore survives past line 358, and this new knownConditionTrueFalse is a false positive. ---- 28 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/libl/liblivemedia/liblivemedia_2026.11.08.orig.tar.gz Result: your live/liveMedia/RTPSource.cpp:244:28: style: The comparison 'fTotBytesReceived_lo < prevTotBytesReceived_lo' is always false because 'fTotBytesReceived_lo' and 'prevTotBytesReceived_lo' represent the same value. [knownConditionTrueFalse] live/liveMedia/RTPSource.cpp:242:39: note: 'prevTotBytesReceived_lo' is assigned value 'fTotBytesReceived_lo' here. live/liveMedia/RTPSource.cpp:244:28: note: The comparison 'fTotBytesReceived_lo < prevTotBytesReceived_lo' is always false because 'fTotBytesReceived_lo' and 'prevTotBytesReceived_lo' represent the same value. Explanation: The code saves the old value with `prev = fTotBytesReceived_lo;`, then does `fTotBytesReceived_lo += packetSize;`, then checks `fTotBytesReceived_lo < prev` to detect wrap-around. The compound assignment changes `fTotBytesReceived_lo`, so the two values are no longer the same and the comparison can be true. The PR's change to isVariableChanged skips the assignment branch for compound assignments when indirect != 0. This makes Cppcheck miss that `+=` modifies the variable here, so it keeps the 'same value' relation. The new knownConditionTrueFalse warning is a false positive. ---- 29 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libm/libmath-cephes-perl/libmath-cephes-perl_0.5308.orig.tar.gz Result: main Math-Cephes-0.5308/libmd/bernum_wrap.c:77:7: error: Uninitialized variable: nx [legacyUninitvar] Explanation: Line 77 `nx += 1;` uses `nx` uninitialized: no assignment to `nx` appears in the shown code. The warning is still reported, with the same location and message, but now by the valueflow-based uninitvar check instead of legacyUninitvar. This happens because the PR treats compound assignments as reads in valueflow. The finding is unchanged for users, only the check id differs. ---- 30 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/libr/libraw/libraw_0.22.3.orig.tar.gz Result: your LibRaw-LibRaw-75d1532/src/metadata/nikon.cpp:580:13: style: Variable 'cblack' can be declared as const array [constVariable] Explanation: `cblack` (a LibRaw array macro, `imgdata.color.cblack`) is written on line 580 (`cblack[...] = get2()`) and modified on line 583 (`cblack[c] -= i`), so it cannot be const. The PR stops `isVariableChanged` from treating compound assignments as modifications when `indirect != 0`. That makes the element write via `-=` invisible and produces this new false-positive constVariable warning. ---- 31 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/libr/libretro-beetle-pce-fast/libretro-beetle-pce-fast_0.9.38.7+git20160609.orig.tar.gz Result: your mednafen/cdrom/lec.cpp:440:23: style: Variable 'q_start' can be declared as pointer to const [constVariablePointer] Explanation: `q_start` is assigned `sector + LEC_MODE1_Q_PARITY_OFFSET` and then only used in the comparison `q_lsb >= q_start`. Nothing is ever written through it, so it can be declared `const u_int8_t *`. Before the PR, the compound assignment `q_lsb -= ...` next to the comparison was apparently treated as a modification through indirection, which suppressed the warning. The PR fixes that, so this is a new true positive. ---- 32 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libr/librnd/librnd_4.5.0.orig.tar.bz2 Result: your librnd-4.5.0/scconfig/src/menulib/scmenu_menu.c:254:33: style: Parameter 'ctx' can be declared as pointer to const [constParameterPointer] Explanation: In `combo_set`, `ctx` is never used. The body only touches `menu` and `value`. Nothing is written through `ctx`, so declaring it `const scm_ctx_t *` is valid. The function is static and called directly; it is not reported as a callback. The new warning looks like a correct true positive. It probably appears because compound assignments through pointers (e.g. `menu->entries[n].flags |= ...`) are no longer treated as changing the pointer variable itself. A more precise message would arguably be 'unused parameter', but the const suggestion is still correct. ---- 33 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libs/libsdl3/libsdl3_3.5~git20261111~e7a4fa6+ds.orig.tar.xz Result: your libsdl3-3.5~git20261111~e7a4fa6/examples/renderer/20-blending/blending.c:149:34: style: Parameter 'appstate' can be declared as pointer to const [constParameterPointer] Explanation: `SDL_AppEvent` is an SDL callback whose prototype is fixed by SDL_main.h as `SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)`. `appstate` is simply unused here. Changing it to `const void *` would conflict with the library's declaration, so the user cannot act on the suggestion. The new constParameterPointer warning is therefore effectively a false positive. Nothing in this function involves compound assignment to a pointer (only the global int `alpha` is modified), so the warning appears as a side effect rather than from better understanding. Cppcheck may already warn on similar unused callback parameters elsewhere, which keeps confidence at medium. ---- 34 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libs/libsoundio/libsoundio_2.0.0.orig.tar.gz Result: your libsoundio-2.0.0/src/coreaudio.c:1103:58: style: Parameter 'si' can be declared as pointer to const. However it seems that 'outstream_end_write_ca' is a callback function, if 'si' is declared with const you might also need to cast function pointer(s). [constParameterCallback] libsoundio-2.0.0/src/coreaudio.c:1472:31: note: You might need to cast the function pointer here libsoundio-2.0.0/src/coreaudio.c:1103:58: note: Parameter 'si' can be declared as pointer to const Explanation: In `outstream_end_write_ca`, the parameter `si` is never used. Only `os` is accessed, through `osca`, and modified with `+=` and `-=`. So `si` can technically be declared as a pointer to const. The function is a callback (used at line 1472), and the message correctly notes that a function pointer cast may be needed. This makes it a valid `constParameterCallback` style finding, consistent with how other similar callbacks are treated. Main likely missed it because the compound assignments were handled differently before the PR. The new warning is a true positive. ---- 35 / 50 ---- Verdict: REGRESSION (low confidence) Package: https://ftp.debian.org/debian/pool/main/m/mdocml/mdocml_1.14.6.orig.tar.gz Result: your mandoc-1.14.6/mdoc_html.c:1420:19: style: Parameter 'n' can be declared as pointer to const. However it seems that 'mdoc_igndelim_pre' is a callback function, if 'n' is declared with const you might also need to cast function pointer(s). [constParameterCallback] mandoc-1.14.6/mdoc_html.c:196:3: note: You might need to cast the function pointer here mandoc-1.14.6/mdoc_html.c:1420:19: note: Parameter 'n' can be declared as pointer to const Explanation: `mdoc_igndelim_pre` is a dispatch-table callback with the shared MDOC_ARGS signature. Its body does not use `n` and modifies `h->flags |= HTML_IGNDELIM`. Read in isolation, a const suggestion for the unused `n` is technically valid. Making it const would force a function-pointer cast, though, so the warning has little value. Main did not report it. The PR now skips `isVariableChanged` detection for compound assignments when `indirect != 0`, so `ptr->member |= x` is no longer seen as a modification through the pointer. The companion new warning on `termp_xx_pre` shows the same breakage: it suggests const for `p`, but that function writes through `p` (in mandoc's source, `p->flags |= TERMP_PREKEEP`), so that warning is a false positive. This warning most likely comes from the same mis-analysis rather than better understanding. The exact way it reaches `n` instead of `h` is not clear, hence low confidence. ---- 36 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/m/mdocml/mdocml_1.14.6.orig.tar.gz Result: your mandoc-1.14.6/mdoc_term.c:1481:14: style: Parameter 'p' can be declared as pointer to const. However it seems that 'termp_xx_pre' is a callback function, if 'p' is declared with const you might also need to cast function pointer(s). [constParameterCallback] mandoc-1.14.6/mdoc_term.c:240:4: note: You might need to cast the function pointer here mandoc-1.14.6/mdoc_term.c:1481:14: note: Parameter 'p' can be declared as pointer to const Explanation: termp_xx_pre does `p->flags |= TERMP_PREKEEP;`, which writes through `p` with a compound assignment. So `p` cannot be a pointer to const. The PR's new `indirect == 0 || str() == "="` condition in isVariableChanged stops treating compound assignments through a dereference/member as a modification. That produces this new false positive. ---- 37 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/m/metaeuk/metaeuk_7-bba0d80+ds.orig.tar.xz Result: your metaeuk-7-bba0d80/lib/mmseqs/src/commons/BaseMatrix.cpp:180:7: error: If memory allocation fails: pointer addition with NULL pointer. [nullPointerArithmeticOutOfMemory] metaeuk-7-bba0d80/lib/mmseqs/src/commons/BaseMatrix.cpp:177:32: note: Assuming allocation function fails metaeuk-7-bba0d80/lib/mmseqs/src/commons/BaseMatrix.cpp:177:18: note: Assignment 'data=(char*)malloc(memorySize(matrixName,matrixData)+1)', assigned value is 0 metaeuk-7-bba0d80/lib/mmseqs/src/commons/BaseMatrix.cpp:178:13: note: p is assigned 'data' here. metaeuk-7-bba0d80/lib/mmseqs/src/commons/BaseMatrix.cpp:180:7: note: Null pointer addition Explanation: In `serialize()`, `data` comes from `malloc()` and is never checked for NULL. `p = data` and then `p += matrixName.size()` runs on line 180. If the allocation fails, this is arithmetic on a NULL pointer, which is exactly what `nullPointerArithmeticOutOfMemory` reports. Before the PR, the compound assignment `p +=` was treated as killing the tracked value, so this was missed. The PR's own updated test in `testnullpointer.cpp` (`p += a` now flagged) expects this kind of warning. This is a new true positive. ---- 38 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/m/micropython/micropython_1.26.1+ds.orig.tar.xz Result: your micropython-1.26.1/py/reader.c:70:52: style: Parameter 'reader' can be declared as pointer to const [constParameterPointer] Explanation: The function only reads through `reader`: it compares `reader->readbyte` and loads `reader->data`. The write `m->cur += len` changes the separate `mp_reader_mem_t` object that `reader->data` points to, not `*reader`. With `const mp_reader_t *reader`, `reader->data` becomes `void * const`, and in C it still converts implicitly to a non-const `mp_reader_mem_t *`. So the parameter can be declared pointer to const. Main missed this because it treated a compound assignment at indirect > 0 as a modification of `reader`; the PR fixes that, so this is a new true positive. ---- 39 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/o/octave-nan/octave-nan_3.7.0.orig.tar.gz Result: your nan-3.7.0/src/linear.cpp:682:19: style: Variable 'xi' can be declared as pointer to const [constVariablePointer] Explanation: In the visible code `xi` is only read: `xi->index` and `xi->value` are read, and `xi++` changes the pointer itself, not what it points to. In upstream liblinear's MCSVM_CS solver, the later use in this scope does `xi = prob->x[i]` and writes through `w_i`, never through `xi`. So `xi` can be `const feature_node *`, and the new constVariablePointer warning looks like a true positive. The PR stops treating compound assignment as a write through the pointer, which explains why it now appears. Confidence is medium because the rest of the scope is not shown. ---- 40 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/p/plus42/plus42_1.5.1+ds.orig.tar.xz Result: your plus42-upstream-1.5.1/common/core_globals.cc:3441:20: style: Variable 'dir' can be declared as pointer to const [constVariablePointer] Explanation: `dir` is only read: `dir->prgms + current_prgm.idx` initializes `prgm`, and the write `prgm->text[pc + 1] ^= 4` goes through `prgm`, not through `dir`. In Plus42, `directory::prgms` appears to be a dynamically allocated `prgm_struct *` member (there is a `prgms_capacity` field, and lines 3403-3405 resize and NULL entries). If so, `const directory *dir` still gives a non-const `prgm_struct *` from `dir->prgms + idx`, so the code would compile and the suggestion is correct. The PR no longer treats compound assignments through indirection as a change of the variable itself, which exposes this true positive. Confidence is medium because the struct definition is not shown. ---- 41 / 50 ---- Verdict: IMPROVEMENT (low confidence) Package: https://ftp.debian.org/debian/pool/main/r/rinetd/rinetd_0.73.orig.tar.gz Result: your parse.peg:309:43: style: Parameter 'text' can be declared as pointer to const. However it seems that 'yyPop' is a callback function, if 'text' is declared with const you might also need to cast function pointer(s). [constParameterCallback] parse.peg:1429:35: note: You might need to cast the function pointer here parse.peg:309:43: note: Parameter 'text' can be declared as pointer to const Explanation: Line 309 of the peg/leg-generated parser is almost certainly `YY_LOCAL(void) yyPop(yycontext *yy, char *text, int count) { yy->__val -= count; }`; column 43 lines up with the `text` parameter. Only `yy->__val` is changed (by a compound assignment); `text` is never written through. So declaring `text` as `const char *` would be valid, and the new constParameterCallback warning looks like a true positive. It also correctly notes that yyPop is used as a callback whose function pointer would need a cast. The PR stops treating compound assignments with indirection as pointee writes, which plausibly removed a previous false 'changed' result. Confidence is low because the generated source is not shown and it is unclear exactly why main missed this. ---- 42 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/s/seqprep/seqprep_1.3.2.orig.tar.gz Result: your SeqPrep-1.3.2/stdaln.c:889:25: error: If memory allocation fails: pointer addition with NULL pointer. [nullPointerArithmeticOutOfMemory] SeqPrep-1.3.2/stdaln.c:887:27: note: Assuming allocation function fails SeqPrep-1.3.2/stdaln.c:887:8: note: Assuming condition '_mem' is false SeqPrep-1.3.2/stdaln.c:887:12: note: Assignment 'mem=_mem?_mem:calloc((len1+2)*(N_MATRIX_ROW+1),4)', assigned value is 0 SeqPrep-1.3.2/stdaln.c:888:5: note: _p is assigned 'mem' here. SeqPrep-1.3.2/stdaln.c:889:25: note: Null pointer addition Explanation: At line 887, `mem` is set from `calloc` when `_mem` is NULL, and the result is never checked. `_p = mem` copies it, and then `_p += 4 * (len1 + 2)` does pointer arithmetic on that value. If the allocation fails, this adds an offset to a NULL pointer, which is undefined behavior. The PR makes the value-flow analyzer treat a compound assignment as a read of the old value, so it now sees the NULL value at `+=`. This matches the updated `p += a` test in testnullpointer.cpp. The new nullPointerArithmeticOutOfMemory warning is a genuine (if minor) true positive about unchecked allocation. ---- 43 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/s/silo-llnl/silo-llnl_4.12.2~pre1.orig.tar.xz Result: your silo-llnl-4.12.2~pre1/src/pdb/pdrdwr.c:1520:17: warning: Either the condition 'svr==NULL' is redundant or there is pointer arithmetic with NULL pointer. [nullPointerArithmeticRedundantCheck] silo-llnl-4.12.2~pre1/src/pdb/pdrdwr.c:1518:21: note: Assuming that condition 'svr==NULL' is not redundant silo-llnl-4.12.2~pre1/src/pdb/pdrdwr.c:1520:17: note: Null pointer addition Explanation: The PR makes `svr += size` count as a read of `svr`, so Cppcheck now reports null pointer arithmetic after the `svr == NULL` check. That check is followed by `lite_PD_error(...)`. In PDB-lite this function most likely longjmps to the error handler for PD_WRITE (recalled from the library, not shown here), so it would not return. The null check is then a deliberate guard and `svr += size` is never reached with a NULL `svr`. Cppcheck cannot see that the function does not return, so the new warning is very likely a false positive in this code. The underlying analysis change is reasonable in general, but here it adds noise. ---- 44 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/s/skycat/skycat_3.1.2+starlink1~b+dfsg.orig.tar.gz Result: your skycat-3.1.2-starlink-1b/cat/generic/LocalCatalog.C:168:15: error: If memory allocation fails: pointer addition with NULL pointer. [nullPointerArithmeticOutOfMemory] skycat-3.1.2-starlink-1b/cat/generic/LocalCatalog.C:154:34: note: Assuming allocation function fails skycat-3.1.2-starlink-1b/cat/generic/LocalCatalog.C:154:21: note: Assignment 'com=(char*)std::malloc(have)', assigned value is 0 skycat-3.1.2-starlink-1b/cat/generic/LocalCatalog.C:156:19: note: Assignment 'p=com', assigned value is 0 skycat-3.1.2-starlink-1b/cat/generic/LocalCatalog.C:161:30: note: Assuming condition is false skycat-3.1.2-starlink-1b/cat/generic/LocalCatalog.C:168:15: note: Null pointer addition Explanation: `com = (char*)malloc(have)` at line 154 is never checked for NULL. `p = com` copies it, and if the realloc branch is skipped, `p += l` at line 168 does arithmetic on a NULL pointer. The PR deliberately makes compound assignments like `+=` read the tracked value, so Cppcheck now catches this (the PR's nullPointerArithmetic test change covers the same pattern). Along the malloc-failure path the warning is factually correct. It is somewhat redundant, since `com[0]` at line 155 and `strcpy(p, c)` at line 166 would already dereference NULL earlier. Still, it points at a real missing allocation check, so it is a true positive rather than noise. ---- 45 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/s/synfig/synfig_1.5.5+dfsg.orig.tar.xz Result: main synfig-1.5.5/synfig-core/test/benchmark.cpp:185:3: error: Uninitialized variable: t [legacyUninitvar] Explanation: `t` is declared without an initializer and is first used in `t+=...` at line 185, so it really is read uninitialized. Main reported this through the legacy check (legacyUninitvar, error). With the PR, the valueflow uninit analysis now treats compound assignment as a read and reports the same line as uninitvar (warning). The true positive is still reported at the same location. Only the checker ID and severity changed; the severity drop is a minor loss of precision, since the loop clearly runs, so overall this is essentially neutral. ---- 46 / 50 ---- Verdict: IMPROVEMENT (low confidence) Package: https://ftp.debian.org/debian/pool/main/t/thc-ipv6/thc-ipv6_3.8.orig.tar.gz Result: your thc-ipv6-3.8/dump_dhcp6.c:64:18: style: Variable 'ptr' can be declared as pointer to const [constVariablePointer] Explanation: `ptr` is initialized from `data`, which is a `const unsigned char *`, by casting the const away. The PR stops treating compound assignments such as `p += n` as writes through the pointer, since they only change the pointer itself. That lets constVariablePointer fire for pointers that are only moved and read. Writing into the read-only pcap packet buffer through `ptr` would be unusual, so the warning is probably correct. However, the rest of the function, where `ptr` is used, is not shown, so a write through `ptr` cannot be ruled out. ---- 47 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/v/vde2/vde2_2.3.2+r586.orig.tar.gz Result: your vde2-2.3.2/src/vde_over_ns/vde_over_ns.c:377:10: warning: Either the condition 'data' is redundant or there is pointer arithmetic with NULL pointer. [nullPointerArithmeticRedundantCheck] vde2-2.3.2/src/vde_over_ns/vde_over_ns.c:375:9: note: Assuming that condition 'data' is not redundant vde2-2.3.2/src/vde_over_ns/vde_over_ns.c:377:10: note: Null pointer addition Explanation: Line 375 checks `if (data)`, which implies `data` may be NULL. Line 377 then does `data += l` unconditionally. If `data` is NULL, that is pointer arithmetic on a NULL pointer, which is undefined behavior in C. Before this PR, compound assignment was not treated as a read of the pointer value, so the warning was missed. The PR's own test now expects nullPointerArithmetic for the same `p += a` pattern. The new nullPointerArithmeticRedundantCheck is a legitimate finding: either the check is redundant or the arithmetic can hit NULL. ---- 48 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/v/vtk7/vtk7_7.1.1+dfsg2.orig.tar.xz Result: your VTK-7.1.1/Filters/Core/vtkSynchronizedTemplatesCutter3D.cxx:161:7: error: Pointer addition with NULL pointer. [nullPointerArithmetic] VTK-7.1.1/Filters/Core/vtkSynchronizedTemplatesCutter3D.cxx:567:43: note: Calling function 'ContourImage', 5th argument '(double*)0' value is 0 VTK-7.1.1/Filters/Core/vtkSynchronizedTemplatesCutter3D.cxx:161:7: note: Null pointer addition Explanation: The call at line 567 passes a literal `(double*)0` as `ptr`, and `ContourImage` then does `ptr += self->GetArrayComponent();`. Adding a possibly non-zero value to a null pointer is undefined behavior; `ArrayComponent` is user-settable even though it defaults to 0. Cppcheck already warns about `p + a` with null `p`. The PR now handles compound assignment `+=` the same way instead of treating it as an invalidating write, which is exactly what the updated test expects. The new warning is a genuine, if low-impact, true positive. ---- 49 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/x/xtables-addons/xtables-addons_3.31.orig.tar.xz Result: your xtables-addons-3.31/extensions/libxt_lscan.c:44:19: style: Parameter 'flags' can be declared as pointer to const. However it seems that 'lscan_mt_parse' is a callback function, if 'flags' is declared with const you might also need to cast function pointer(s). [constParameterCallback] xtables-addons-3.31/extensions/libxt_lscan.c:103:19: note: You might need to cast the function pointer here xtables-addons-3.31/extensions/libxt_lscan.c:44:19: note: Parameter 'flags' can be declared as pointer to const Explanation: The full body of lscan_mt_parse (lines 43-66) is shown, and it never reads or writes 'flags'. It only modifies 'info' through compound assignments ('|='). So 'flags' really could be a pointer to const. Cppcheck's own tests show that unused pointer parameters are normally reported (e.g. 'void h(int *p) {}'). The message correctly uses the callback variant and points to where the function pointer is used at line 103. The new warning is therefore a technically correct true positive that main had missed. It is plausibly linked to the PR's changed handling of compound assignments. ---- 50 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/z/zabbix/zabbix_7.0.29+dfsg.orig.tar.xz Result: your zabbix-7.0.29/src/libs/zbxcrypto/aes.c:502:11: style: Variable 'Iv' can be declared as pointer to const [constVariablePointer] Explanation: `Iv` is only read through. It is passed to `XorWithIv` as a `const uint8_t *`, reassigned to point at `buf`, and used as the source of `memcpy`. Nothing is ever written through it, so it can be declared `const uint8_t *Iv`. Before the PR, `buf += AES_BLOCKLEN` (a compound assignment to the pointer itself) was wrongly treated as changing the pointed-to data of the aliased `Iv`, which suppressed the warning. The PR fixes this, and the case matches the new test in testother.cpp. This is a correctly added true positive.