AI review of 2026-11-15_13-25-12-6edbf5f84b8d-results.txt PR: #8996 https://github.com/cppcheck-opensource/cppcheck/pull/8996 Tested: 6edbf5f84b8db88b0e4ade40c5791b1b90d940ab Merge base: 275e673c62902ac61e79d4151ced6a4882e50707 Reviewed: 2026-11-16 23:41:58 UTC Model: claude-opus-5-5 (effort high) Results: 50 reviewed of 269 in the report (random sample), 1 not reviewed: valueFlowMaxIterations Verdicts: 2 acceptable regression, 38 improvement, 9 regression, 1 unclear Tokens: 115190 input, 117640 cache read, 29410 cache write, 41932 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/ascii-patrol/ascii-patrol_1.7+dfsg.orig.tar.xz Result: your ascii-patrol-1.7/unmo3.cpp:161:9: error: If memory allocation fails: pointer addition with NULL pointer. [nullPointerArithmeticOutOfMemory] ascii-patrol-1.7/unmo3.cpp:154:50: note: Assuming allocation function fails ascii-patrol-1.7/unmo3.cpp:154:28: note: Assignment 'data_hdr=(unsigned char*)malloc(file_hdr->hdrlen)', assigned value is 0 ascii-patrol-1.7/unmo3.cpp:158:25: note: hdr_ptr is assigned 'data_hdr' here. ascii-patrol-1.7/unmo3.cpp:161:9: note: Null pointer addition Explanation: `data_hdr` comes from an unchecked `malloc` and is copied into `hdr_ptr`. If the allocation fails, `hdr_ptr += strlen(song_name)+1` does arithmetic on a NULL pointer. Before the PR, the compound assignment `+=` counted as a plain variable change, so the null value never reached it. Now it is treated as a read followed by invalidation, which matches the PR's updated test expecting nullPointerArithmetic for `p += a`. The program would probably crash earlier (`mo3_unpack` writing to `data_hdr`, or `strlen(NULL)`), but the missing allocation check is a real defect. This is a valid nullPointerArithmeticOutOfMemory true positive. ---- 2 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/b/bibutils/bibutils_7.2.orig.tar.gz Result: your bibutils_7.2/lib/endin.c:103:17: style: Variable 'up' can be declared as pointer to const [constVariablePointer] Explanation: 'up' is assigned from '(unsigned char*)p' and only read afterwards (up[0], up[1], up[2]). Declaring it 'const unsigned char *up' is valid, so the warning is a true positive. Before the PR, Cppcheck treated the compound assignment 'p += 3' to the aliased pointer as a change of the pointed-to data, which hid the warning. The PR fixes that: '+=' changes only the pointer, not its target, so a missed true positive is now reported. ---- 3 / 50 ---- Verdict: IMPROVEMENT (low confidence) Package: https://ftp.debian.org/debian/pool/main/c/clamav/clamav_1.4.6+dfsg.orig.tar.xz Result: your clamav-1.4.6+dfsg/.cargo/vendor/libfuzzer-sys/libfuzzer/dataflow/DataFlowCallbacks.cpp:65:66: style: Parameter 'Cases' can be declared as pointer to const [constParameterPointer] Explanation: `Cases` is a pointer parameter that the function body never uses. It is never written through, so declaring it as a pointer to const is technically valid, and Cppcheck normally reports unused non-const pointer parameters (its own test `void h(int *p) {}` is flagged). The new warning is therefore consistent with existing behaviour and is a true positive. The value is limited, though: this is an `extern "C"` sanitizer hook whose signature mirrors a fixed interface, so a developer may not want to change it. It is also not obvious from the PR how the compound-assignment change caused this warning to appear, which is why confidence is low. ---- 4 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/c/colobot/colobot_0.2.2.orig.tar.gz Result: your colobot-colobot-gold-0.2.2-alpha/src/CBot/CBotStack.cpp:77:8: error: If memory allocation fails: pointer addition with NULL pointer. [nullPointerArithmeticOutOfMemory] colobot-colobot-gold-0.2.2-alpha/src/CBot/CBotStack.cpp:69:39: note: Assuming allocation function fails colobot-colobot-gold-0.2.2-alpha/src/CBot/CBotStack.cpp:69:32: note: Assignment 'p=static_cast(malloc(size))', assigned value is 0 colobot-colobot-gold-0.2.2-alpha/src/CBot/CBotStack.cpp:76:19: note: pp is assigned 'p' here. colobot-colobot-gold-0.2.2-alpha/src/CBot/CBotStack.cpp:77:8: note: Null pointer addition Explanation: Line 69 assigns the result of `malloc` to `p` without a null check. `pp` is then set to `p`, and line 77 does `pp += MAXSTACK`. If the allocation fails, this is pointer arithmetic on a NULL pointer, which is undefined behaviour. Before the PR, the compound assignment `pp += MAXSTACK` was treated as a change to `pp`, so the possible null value was dropped before it was checked. The PR keeps the value for the read part of the compound assignment, matching the updated `nullPointerArithmetic` unit test. The new `nullPointerArithmeticOutOfMemory` warning is a valid true positive of the same kind as the existing out-of-memory checks. ---- 5 / 50 ---- Verdict: ACCEPTABLE REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/c/cxref/cxref_1.6e.orig.tar.gz Result: main cxref-1.6e/cpp/cccp.c:6198:32: style: Variable 'lastp' can be declared as pointer to const [constVariablePointer] Explanation: In collect_expansion, `lastp` is a marker pointer into the expansion buffer. In GCC's cccp.c it is only assigned from `exp_p` and then used in comparisons and differences such as `exp_p - lastp`. Nothing is ever written through it, so it could be `const U_CHAR *` and the constVariablePointer warning was a true positive. The PR changes how compound assignments (e.g. `exp_p += …`) affect value tracking and variable-change detection, and this apparently suppressed the warning. The removal is a new false negative of a stylistic check. The full function body is not shown here, so this rests on the known GCC cccp.c code. ---- 6 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/d/dascrubber/dascrubber_1.1.orig.tar.gz Result: your DASCRUBBER-1.1/DAStrim.c:366:23: style: Variable 'dptr' can be declared as pointer to const [constVariablePointer] Explanation: In `find_walls`, `dptr` most likely just holds the end pointer returned by `wall_detector(dels,0,ntip,aptr)`. It is then used only for pointer arithmetic (`*dnum = dptr-aptr`) and never dereferenced for writing. Assigning a `Wall*` to a `const Wall*` is valid, so declaring `dptr` as pointer to const would compile and is correct. The PR stops treating a compound assignment like `p += n` as a change of the pointed-to data. That removes a false negative, and this new constVariablePointer warning appears to be a true positive. The rest of the function is not shown, so confidence is medium. ---- 7 / 50 ---- Verdict: ACCEPTABLE REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/d/dolphin-emu/dolphin-emu_2609.b+dfsg.orig.tar.xz Result: main dolphin-emu-2609b/Source/Core/Core/PowerPC/GDBStub.cpp:614:10: style: Variable 'bufptr' is assigned a value that is never used. [unreadVariable] Explanation: In WriteRegisters(), `bufptr += 32 * 8;` at line 614 is the last use of the local pointer `bufptr`. The function then only calls SendReply("OK"), so the new value is never read. The unreadVariable warning was a true positive. The PR changed how compound assignments are handled in isVariableChanged and the valueflow analyzer. That change caused this correct warning to disappear, which is a new false negative. The identical pattern at line 597 in ReadRegisters is not in the diff, so it is presumably still reported. ---- 8 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/e/emboss/emboss_6.6.0+dfsg.orig.tar.xz Result: your EMBOSS-6.6.0/ajax/zlib/deflate.c:1089:21: style: Variable 'strend' can be declared as pointer to const [constVariablePointer] Explanation: This is zlib's longest_match. In the non-UNALIGNED_OK path, strend is only compared and subtracted, but it is also assigned back to a non-const pointer: `scan = strend - MAX_MATCH;`. scan is a non-const `Bytef*` and Cppcheck does not suggest making it const. So declaring strend as `const Bytef*` alone would make that assignment drop the const qualifier, which is a diagnostic in C and an error in C++. The PR's new rule that compound assignments such as `scan += 2` do not modify the pointee seems to have stopped Cppcheck from noticing that strend's value flows into a pointer it treats as non-const. The new constVariablePointer warning therefore looks like a false positive. ---- 9 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/f/ffmpeg/ffmpeg_9.0.2.orig.tar.xz Result: your ffmpeg-9.0.2/libavfilter/vf_mix.c:265:13: style: Variable 'sum' can be declared as pointer to const [constVariablePointer] Explanation: Line 265 expands `FAST_TMIX_SLICE(float, float, 0.f)`. The macro body is not shown here; from upstream ffmpeg it declares `stype *sum = ...` and then writes through it in the loop with `sum[x] += src[1][x] * ...` and `sum[x] -= src[0][x]`. Those compound assignments modify the pointee, so declaring `sum` as pointer to const would not compile, and the warning is a false positive. The PR changed `isVariableChanged` so compound assignments are only treated as changes when `indirect - derefs == 0`. That correctly stops `sum += sum_linesize` from counting as a pointee write, but it apparently also stopped `sum[x] +=` from being recognised as one. The same pattern explains many other new constParameterPointer/constVariablePointer warnings in this package, such as the repeated `dst` warnings in the mips files and `sum` at lines 261 and 263. ---- 10 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/f/filament/filament_1.9.25+dfsg3.orig.tar.xz Result: your filament-1.9.25/libs/filameshio/src/MeshReader.cpp:319:21: error:inconclusive: If memory allocation fails: pointer addition with NULL pointer. [nullPointerArithmeticOutOfMemory] filament-1.9.25/libs/filameshio/src/MeshReader.cpp:306:36: note: Assuming allocation function fails filament-1.9.25/libs/filameshio/src/MeshReader.cpp:306:36: note: Assignment 'uncompressed=malloc(uncompressedSize)', assigned value is 0 filament-1.9.25/libs/filameshio/src/MeshReader.cpp:309:27: note: Assuming condition is false filament-1.9.25/libs/filameshio/src/MeshReader.cpp:314:32: note: Assignment 'dstdata=(uint8_t*)uncompressed', assigned value is 0 filament-1.9.25/libs/filameshio/src/MeshReader.cpp:319:21: note: Null pointer addition Explanation: `uncompressed = malloc(...)` is never checked for NULL. `dstdata` is set to `(uint8_t*)uncompressed`, and `dstdata += sizeof(half4) * vertexCount` then does arithmetic on it. If the allocation fails, that is NULL pointer arithmetic with a non-zero offset, which is undefined behaviour. The PR makes compound assignment count as a read of the old value instead of a plain overwrite. That lets the null value reach line 319, matching the updated nullPointerArithmetic test. This is a genuine (OOM-conditional, inconclusive) true positive. ---- 11 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/g/gegl/gegl_0.4.72.orig.tar.xz Result: your gegl-0.4.72/operations/common/edge-sobel.c:254:29: style: Variable 'row_next' can be declared as pointer to const [constVariablePointer] Explanation: `row_next` is computed as `row_start + width*4` and, in the clamping logic after the shown excerpt, is apparently only compared against `r_px` (`else if (r_px >= row_next)`). It is never written through. So `const gfloat *row_next` would be valid, and the new constVariablePointer warning looks like a true positive. Main missed it because compound assignments such as `r_px -= 4` were wrongly treated as changing the pointed-to data. The PR fixes exactly that, and its new test case covers this pattern. Confidence is medium only because the full use of `row_next` is not shown. ---- 12 / 50 ---- Verdict: IMPROVEMENT (low confidence) Package: https://ftp.debian.org/debian/pool/main/g/gegl/gegl_0.4.72.orig.tar.xz Result: your gegl-0.4.72/operations/workshop/sharpen.c:32:47: style: Parameter 'operation' can be declared as pointer to const. However it seems that 'get_required_for_output' is a callback function, if 'operation' is declared with const you might also need to cast function pointer(s). [constParameterCallback] gegl-0.4.72/operations/workshop/sharpen.c:184:48: note: You might need to cast the function pointer here gegl-0.4.72/operations/workshop/sharpen.c:32:47: note: Parameter 'operation' can be declared as pointer to const Explanation: In `get_required_for_output`, the parameter `operation` is never written through. Only `roi` is dereferenced, and the only writes are compound assignments to the local `ret`. So declaring `operation` as `const GeglOperation *` is technically valid. The constParameterCallback wording correctly notes that this is a GEGL class callback and that the function pointer at line 184 would need a cast. The diff does not show why the PR's compound-assignment handling makes this warning appear. Other new warnings in this package fit the PR's fix, which no longer treats `ptr += n` as writing through the pointer. This one looks like a correct new finding, but its practical value is limited because of the fixed callback signature, hence low confidence. ---- 13 / 50 ---- Verdict: IMPROVEMENT (low confidence) Package: https://ftp.debian.org/debian/pool/main/g/gnunet/gnunet_0.20.0.orig.tar.xz Result: your gnunet-0.20.0/src/dht/test_dht_topo.c:266:21: style: Parameter 'cls' can be declared as pointer to const. However it seems that 'handle_stats' is a callback function, if 'cls' is declared with const you might also need to cast function pointer(s). [constParameterCallback] gnunet-0.20.0/src/dht/test_dht_topo.c:420:42: note: You might need to cast the function pointer here gnunet-0.20.0/src/dht/test_dht_topo.c:266:21: note: Parameter 'cls' can be declared as pointer to const Explanation: `handle_stats` never uses `cls`; the body only reads `subsystem`, `name` and `value` and updates the global `stats[i].total`. So `cls` could technically be `const void *`. The new warning is the callback-specific variant: it notes the function pointer use at line 420 and that a cast may be needed, which matches how Cppcheck already reports unused pointer parameters (the existing test `void h(int *p) {}` gets a warning). The diff does not show why the PR's change to compound-assignment handling makes this warning appear here. On the code shown it is a valid, if low-value, style true positive, hence low confidence. ---- 14 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/k/kylin-cloud-ai-engine-plugin/kylin-cloud-ai-engine-plugin_1.1.0.2.orig.tar.xz Result: your kylin-cloud-ai-engine-plugin-1.1.0.2/third-party/libhv-v1.3.3/mqtt/mqtt_client.c:592:7: error:inconclusive: Pointer addition with NULL pointer. [nullPointerArithmetic] kylin-cloud-ai-engine-plugin-1.1.0.2/third-party/libhv-v1.3.3/mqtt/mqtt_client.c:588:26: note: Assignment 'buf=NULL', assigned value is 0 kylin-cloud-ai-engine-plugin-1.1.0.2/third-party/libhv-v1.3.3/mqtt/mqtt_client.c:590:22: note: p is assigned 'buf' here. kylin-cloud-ai-engine-plugin-1.1.0.2/third-party/libhv-v1.3.3/mqtt/mqtt_client.c:592:7: note: Null pointer addition Explanation: `buf` is set to NULL and then passed to `HV_STACK_ALLOC(buf, buflen)`. In libhv this macro assigns `buf` either a heap allocation or a local stack buffer, through `*(unsigned char**)&(ptr) = _stackbuf_`. So `p = buf` is never NULL when `p += headlen` runs. Cppcheck does not see the assignment hidden in the macro: either the macro is not expanded, or the cast and address-of write is missed. It therefore still treats `buf` as NULL. The PR now treats compound assignment (`p += headlen`) as a read of the pointer, which exposes this stale NULL value. The new inconclusive nullPointerArithmetic warning is a false positive. ---- 15 / 50 ---- Verdict: IMPROVEMENT (low confidence) Package: https://ftp.debian.org/debian/pool/main/l/lebiniou/lebiniou_3.67.0.orig.tar.xz Result: your lebiniou-3.67.0/plugins/main/GLCube/GLCube.c:72:19: style: Parameter 'ctx' can be declared as pointer to const [constParameterPointer] Explanation: In `create(Context_t *ctx)`, `ctx` is never written through. The only writes are compound assignments (`*=`) to the global array `CUBE`. `WIDTH` and `HEIGHT` are at most read. So the parameter could be `const`, and the new constParameterPointer warning is technically correct. The PR stops compound assignments with an indirection mismatch from being treated as pointer modifications, which is probably what removed the earlier false negative. The caveat is that `create` is a plugin entry point with a fixed signature, likely loaded via dlsym, so users may not want to change it. That is why confidence is low. ---- 16 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libs/libskia/libskia_146.20260602~git.3476902+dfsg.orig.tar.xz Result: your libskia-146.20260602~git.3476902/src/gpu/vk/VulkanPreferredFeatures.cpp:1501:27: style: Variable 'features' can be declared as pointer to const [constVariablePointer] Explanation: In this block, `features` is a local pointer that is only used by `DUP_INTO(fVulkan12, shaderSubgroupExtendedTypes)`. The new warning shows that the macro uses `features->field` as the right-hand operand of a compound assignment into `fVulkan12`. That means the pointee is only read, never modified. Before the PR, `isVariableChanged` wrongly treated the right-hand side of a compound assignment as possibly changed through the left-hand lvalue check, which suppressed this warning. Declaring `features` as a pointer to const is valid here, so this is a new true positive. ---- 17 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libs/libskia/libskia_146.20260602~git.3476902+dfsg.orig.tar.xz Result: your libskia-146.20260602~git.3476902/src/gpu/vk/VulkanPreferredFeatures.cpp:1543:27: style: Variable 'features' can be declared as pointer to const [constVariablePointer] Explanation: Here `features` is a `reinterpret_cast` of `pNext`. It is only used inside `DUP_INTO(fVulkan12, X)`, which copies the feature flag from `features->X` into the `fVulkan12` aggregate. The macro body is not shown, but its usage and naming indicate it only reads `features`. So `features` can be a pointer to const, e.g. via `reinterpret_cast(pNext)`. The PR stops `isVariableChanged` from treating a pointer that appears in a compound assignment as modified when the indirection level does not match. That removes a false negative, and the PR adds a matching constVariablePointer test. The new warning is therefore likely a true positive. ---- 18 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libs/libskia/libskia_146.20260602~git.3476902+dfsg.orig.tar.xz Result: your libskia-146.20260602~git.3476902/src/gpu/vk/VulkanPreferredFeatures.cpp:1614:27: style: Variable 'features' can be declared as pointer to const [constVariablePointer] Explanation: `features` is cast from `pNext` and used only by `DUP_INTO(fVulkan13, privateData)`. The macro body is not shown, but its name and the surrounding logic point to copying the field from the extension struct into the core `fVulkan13` struct. In the Vulkan 1.3 branch the struct is not chained again; its values are only merged into the core struct. That means `features` is only read, probably on the right-hand side of a plain or compound assignment to `fVulkan13.privateData`. Main wrongly treated `features` as modified there. The PR stops treating a compound assignment as a change to a pointer that is only read, so declaring it `const auto*` is valid. This looks like a new true positive. ---- 19 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libv/libvpx/libvpx_1.17.0.orig.tar.gz Result: main libvpx-1.17.0/vpx_dsp/arm/idct32x32_add_neon.c:530:31: warning: Uninitialized variable: input_pass2 [uninitvar] libvpx-1.17.0/vpx_dsp/arm/idct32x32_add_neon.c:518:32: note: Assignment 'input_pass2=pass1', assigned value is libvpx-1.17.0/vpx_dsp/arm/idct32x32_add_neon.c:530:31: note: Uninitialized variable: input_pass2 Explanation: `input_pass2` points to `pass1`. During loop iteration 0, `pass1` is filled through `out` (`out = pass1`, then the store helpers write to it). It is only read in iteration 1 (`idct32_pass_loop != 0`), so the uninitvar report is a false positive both before and after the PR. The PR does not remove it. Instead the severity goes from 'warning' (possible value) to 'error' (known value). A false positive is now stated with more certainty, so the message is less accurate. ---- 20 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libv/libvpx/libvpx_1.17.0.orig.tar.gz Result: your libvpx-1.17.0/vpx_dsp/arm/idct32x32_add_neon.c:530:31: error: Uninitialized variable: input_pass2 [uninitvar] libvpx-1.17.0/vpx_dsp/arm/idct32x32_add_neon.c:518:32: note: Assignment 'input_pass2=pass1', assigned value is libvpx-1.17.0/vpx_dsp/arm/idct32x32_add_neon.c:530:31: note: Uninitialized variable: input_pass2 Explanation: `input_pass2` points to `pass1`. `pass1` is filled through `out` (which starts as `pass1`) during the first iteration of the outer loop. It is only read via `input_pass2` in the second iteration (`idct32_pass_loop != 0`), so it is initialized by then. The uninitvar report is a false positive both before and after. The PR changes how the compound assignment `input_pass2 += 32*8` is handled, which raises the severity from warning (possible) to error (certain). This makes an existing false positive look more confident, so the message is less accurate. ---- 21 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libx/libxkbfile/libxkbfile_1.1.0.orig.tar.gz Result: your libxkbfile-1.1.0/src/maprules.c:1431:9: warning: Either the condition 'out' is redundant or there is pointer arithmetic with NULL pointer. [nullPointerArithmeticRedundantCheck] libxkbfile-1.1.0/src/maprules.c:1429:9: note: Assuming that condition 'out' is not redundant libxkbfile-1.1.0/src/maprules.c:1431:9: note: Null pointer addition Explanation: Line 1429 checks `out` for null, which tells Cppcheck that `out` may be NULL. Line 1431 then runs `out += strlen(out) + 1` without any guard. If `out` were NULL, that would be pointer arithmetic on NULL, and `strlen(NULL)` before it is already undefined behaviour. In practice `data` is non-null here, so the null check is redundant. The message says exactly that: either the condition is redundant or there is a NULL pointer problem. The PR makes compound assignments like `p += a` count as a read, so the possible-null value now reaches this line. This matches the PR's updated nullPointerArithmetic test. This is a legitimate new true positive about inconsistent code. ---- 22 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/m/memtest86+/memtest86+_8.10.orig.tar.gz Result: your memtest86plus-memtest86plus-494689a/system/loongarch/i2c.c:188:5: warning: Uninitialized variable: device_id [uninitvar] memtest86plus-memtest86plus-494689a/system/loongarch/i2c.c:184:15: note: Assuming condition is false memtest86plus-memtest86plus-494689a/system/loongarch/i2c.c:188:5: note: Uninitialized variable: device_id Explanation: In get_spd, device_id is only set to 0xa1 when the strstr() check on the vendor string succeeds. If that check is false, the compound assignment `device_id |= ...` at line 188 reads an uninitialized variable, so the warning is a true positive. Before the PR, only the legacy checker reported it (legacyUninitvar). Now valueFlow's uninitvar check catches it because compound assignment is treated as a read. The new message is more precise: it comes with a path note ('Assuming condition is false') that explains when the bug happens. The same true positive is now reported by the better checker with more accurate context. ---- 23 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/m/mercury/mercury_1.9.22+ds.orig.tar.xz Result: your Rhizomatica-mercury-b4e24bc/datalink_broadcast/raptorq/lib/uvec.c:36:22: style: Parameter 'v' can be declared as pointer to const [constParameterPointer] Explanation: In bm_set, 'v' is only read: the code reads v->a and v->s, and the write a[q] ^= ... goes through the separate pointer 'a' into the buffer that v->a points to. Declaring the parameter as 'const u32_vec *v' makes v->a a 'u32 * const', and its pointee stays writable, so the code still compiles. The warning is therefore correct. Main presumably missed it because the compound assignment through the derived pointer was wrongly counted as changing 'v'. The PR now handles compound assignments with indirection correctly, so this is a new true positive. ---- 24 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/m/mercury/mercury_1.9.22+ds.orig.tar.xz Result: your Rhizomatica-mercury-b4e24bc/datalink_broadcast/raptorq/lib/uvec.c:43:22: style: Parameter 'v' can be declared as pointer to const [constParameterPointer] Explanation: bm_add only reads v->s and v->a. The writes go through ap, which points into the buffer that v->a points to; the u32_vec struct itself is never modified. Declaring the parameter as 'const u32_vec *v' compiles fine, because v->a then becomes 'u32 * const' and still points to non-const data. Main presumably treated the compound assignment 'ap[idx] ^= ...' through the derived pointer as a change to v. The PR now handles compound assignment with indirection correctly, so this is a newly found true positive. ---- 25 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/m/mercury/mercury_1.9.22+ds.orig.tar.xz Result: your Rhizomatica-mercury-b4e24bc/modem/freedv/unittest/tfmfsk.c:153:15: error:inconclusive: If memory allocation fails: pointer addition with NULL pointer. [nullPointerArithmeticOutOfMemory] Rhizomatica-mercury-b4e24bc/modem/freedv/unittest/tfmfsk.c:145:29: note: Assuming allocation function fails Rhizomatica-mercury-b4e24bc/modem/freedv/unittest/tfmfsk.c:145:14: note: Assignment 'modbuf=(float*)malloc(sizeof(float)*(bitbufsize/fmfsk->nbit)*fmfsk->N*4)', assigned value is 0 Rhizomatica-mercury-b4e24bc/modem/freedv/unittest/tfmfsk.c:149:15: note: Assignment 'modbufp=modbuf', assigned value is 0 Rhizomatica-mercury-b4e24bc/modem/freedv/unittest/tfmfsk.c:153:15: note: Null pointer addition Explanation: `modbuf` comes from an unchecked `malloc` and is copied to `modbufp`. Inside the loop, `modbufp += fmfsk->N` does pointer arithmetic on that value. If the allocation fails, this is arithmetic on a NULL pointer, which is undefined behavior. Before the PR, the compound assignment was treated as a plain write, so the analyzer dropped the null value and missed this. The PR now treats `+=` as reading the old value, which is the behavior the updated nullPointerArithmetic test expects. The new OOM warning is therefore a valid true positive about the missing allocation check. ---- 26 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/m/mercury/mercury_1.9.22+ds.orig.tar.xz Result: your Rhizomatica-mercury-b4e24bc/modem/freedv/unittest/tfsk.c:179:15: error:inconclusive: If memory allocation fails: pointer addition with NULL pointer. [nullPointerArithmeticOutOfMemory] Rhizomatica-mercury-b4e24bc/modem/freedv/unittest/tfsk.c:172:24: note: Assuming allocation function fails Rhizomatica-mercury-b4e24bc/modem/freedv/unittest/tfsk.c:172:9: note: Assignment 'modbuf=(float*)malloc(sizeof(float)*(bitbufsize/fsk->Nbits)*fsk->N*4)', assigned value is 0 Rhizomatica-mercury-b4e24bc/modem/freedv/unittest/tfsk.c:175:15: note: Assignment 'modbufp=modbuf', assigned value is 0 Rhizomatica-mercury-b4e24bc/modem/freedv/unittest/tfsk.c:179:15: note: Null pointer addition Explanation: `modbuf` comes from `malloc` at line 172 and is never checked for NULL. It is copied into `modbufp`, and `modbufp += fsk->N` runs inside the loop. If the allocation fails, that is arithmetic on a NULL pointer, which is undefined behaviour. Before this PR, the compound assignment `+=` was treated as a plain write, so the null value was dropped without being read. Now the left operand of a compound assignment counts as a read, which is the intended behaviour shown in the updated nullPointerArithmetic test. The new inconclusive out-of-memory warning is a legitimate true positive of the same kind Cppcheck already reports for unchecked malloc. ---- 27 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/m/mozjs128/mozjs128_128.14.0.orig.tar.xz Result: your firefox-128.14.0/js/src/ctypes/libffi/src/moxie/ffi.c:180:9: style: Variable 'register_args_ptr' can be declared as pointer to const [constVariablePointer] Explanation: In libffi's moxie closure code, `register_args_ptr` is initialized from `register_args` and later reassigned to `®ister_args[1]`. As far as the shown code and the known upstream source go, it is never written through. Declaring it as `const char *` would compile and keep the same behaviour, so the new constVariablePointer warning looks like a true positive. The variable appears effectively unused, which makes the warning low-value but correct. The rest of the function is not shown, hence medium confidence. ---- 28 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/m/mozjs128/mozjs128_128.14.0.orig.tar.xz Result: your firefox-128.14.0/modules/zlib/src/deflate.c:1371:21: style: Variable 'strend' can be declared as pointer to const [constVariablePointer] Explanation: In zlib's longest_match, `strend` is only used for pointer comparison (`scan < strend`), pointer difference (`strend - scan`) and `scan = strend - MAX_MATCH`. The data it points to is never written, neither through `strend` nor through `scan`, which is only read (`*++scan`, `scan[best_len]`). Before the PR, `scan += 2` was wrongly treated as changing the pointee of `scan`, and that blocked the warning for `strend`. The PR fixes this. This is the same pattern as the PR's new testother case (`p = r; r += s;`). The warning is a valid new style true positive. `scan` would also need to become const to avoid a qualifier mismatch, which it can. ---- 29 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/m/mpqc/mpqc_2.3.1.orig.tar.gz Result: your mpqc-2.3.1/src/lib/chemistry/qc/intv3/comp2e.cc:1529:21: style: Variable 'tmp_int_buffer' can be declared as pointer to const [constVariablePointer] Explanation: At line 1529, tmp_int_buffer is only read, in `tmp_buffer[f34] += tmp_int_buffer[f34]`. The compound assignment writes through tmp_buffer, not tmp_int_buffer. Before the PR, isVariableChanged treated the variable as modified because it sat under the `+=` assignment, even though it is on the right-hand side and only a pointed-to element is read. The PR fixes that. Declaring it as `const double *` is valid, so this new style warning is a true positive. ---- 30 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/n/navit/navit_0.5.6+dfsg.1.orig.tar.xz Result: your navit-0.5.6/navit/support/espeak/synthdata.c:123:7: style: Variable 'pw' can be declared as pointer to const [constVariablePointer] Explanation: In the visible code, `pw` is only assigned `(int *)p` and then read through `pw[1]`, which is passed to `Reverse4Bytes`. Nothing is ever written through `pw`, so declaring it `const int *` is valid and the new warning looks like a true positive. Before the PR, the compound assignment `p += 8` on the aliased pointer `p` was wrongly treated as modifying the pointed-to data. That suppressed the warning. The PR fixes this, and its added test in `testother.cpp` matches this exact pattern. The rest of the function is not shown, but the pattern strongly suggests `pw` is not used elsewhere. ---- 31 / 50 ---- Verdict: IMPROVEMENT (low confidence) Package: https://ftp.debian.org/debian/pool/main/n/netsniff-ng/netsniff-ng_0.6.9.orig.tar.xz Result: your netsniff-ng-0.6.9/cookie.c:20:36: style: Parameter 'cookie' can be declared as pointer to const. However it seems that 'cookie_writer' is a callback function, if 'cookie' is declared with const you might also need to cast function pointer(s). [constParameterCallback] netsniff-ng-0.6.9/cookie.c:46:12: note: You might need to cast the function pointer here netsniff-ng-0.6.9/cookie.c:20:36: note: Parameter 'cookie' can be declared as pointer to const Explanation: `cookie_writer` never uses its `void *cookie` parameter, so it is never written through and could be `const void *`. The new constParameterCallback warning is accurate in Cppcheck's terms. It also correctly points out that the function is used as a callback (`.write = cookie_writer`), so changing the signature would need a cast. The tests show Cppcheck already reports unused pointer parameters like `void h(int *p) {}`, so reporting this one fits existing behavior. The PR's handling of compound assignments (`data += len`, `leng -= len`) probably let the analysis finish this function instead of bailing out. The warning is low-value style advice for a fixed callback signature, but it is not a false positive. ---- 32 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/o/openjpeg2/openjpeg2_2.5.4.orig.tar.xz Result: your openjpeg-2.5.4/src/lib/openjp2/jp2.c:1164:15: style: Variable 'orig_header_data' can be declared as pointer to const [constVariablePointer] Explanation: `orig_header_data` is an alias of `p_pclr_header_data` that saves the start of the buffer. In openjpeg it is only used for a bounds check of the form `p_pclr_header_data - orig_header_data`; nothing is ever written through it. Before the PR, the compound assignments `p_pclr_header_data += 2` and `++p_pclr_header_data` move the alias pointer itself. Cppcheck wrongly treated them as modifying the pointed-to data, which hid this warning. The PR fixes the indirection handling for compound assignments. The pointer can indeed be declared `const OPJ_BYTE *`, so the new constVariablePointer warning is a true positive. ---- 33 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/o/openvlbi/openvlbi_3.0.3.orig.tar.gz Result: your OpenVLBI-3.0.3/dsp/file.c:693:15: error:inconclusive: If memory allocation fails: pointer addition with NULL pointer. [nullPointerArithmeticOutOfMemory] OpenVLBI-3.0.3/dsp/file.c:688:34: note: Assuming allocation function fails OpenVLBI-3.0.3/dsp/file.c:688:11: note: Assignment 'buf=(unsigned char*)malloc(row_stride*(unsigned long)(height))', assigned value is 0 OpenVLBI-3.0.3/dsp/file.c:689:28: note: Assignment 'image=(unsigned char*)buf', assigned value is 0 OpenVLBI-3.0.3/dsp/file.c:693:15: note: Null pointer addition Explanation: `buf` is the unchecked result of `malloc` and is copied into `image`. Inside the loop, `image += row_stride` runs on `image`. If the allocation fails, `image` is NULL, so this is pointer arithmetic on a NULL pointer, which is undefined behavior. `png_read_row` accepts a NULL row pointer, so nothing stops the loop from reaching the addition. Before this PR, Cppcheck dropped the tracked null value at compound assignments, so the `+=` was missed. The PR's own test now expects nullPointerArithmetic for `p += a`. This is a genuine new true positive of the usual missing-malloc-check kind. ---- 34 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/o/openvswitch/openvswitch_4.0.0.orig.tar.xz Result: your openvswitch-4.0.0/ofproto/ofproto-dpif-mirror.c:408:18: error: Uninitialized variable: mbundle->src_mirrors [uninitvar] Explanation: `mbundle` is the loop variable of `CMAP_FOR_EACH`, so it points to existing `mbundle` objects stored in the bridge's cmap, whose `src_mirrors` field was set when they were created. Clearing a bit with `&=` on such a member is ordinary code, not a read of uninitialized memory. The PR's new handling of compound assignments makes the uninit analysis treat `&=` as a read. Cppcheck evidently gets an uninit value for the struct through the container/iterator macro, which it does not model correctly. The new uninitvar warning is therefore a false positive. ---- 35 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/p/plptools/plptools_1.0.26.orig.tar.gz Result: your plptools-1.0.26/plpftp/ftp.cc:584:17: style: Variable 'td' can be declared as pointer to const [constVariablePointer] Explanation: `td` is only used to read data (`*td++`, `buf + *td`) and is incremented itself (`td++`). Nothing is ever written through it, so it can be declared `const uint32_t *td`. The new constVariablePointer warning is a true positive. It was probably missed before because main treated any assignment op (`=` or `+=`) in the expression containing `td` as a modification of the pointed-to data. The PR now limits that check to plain `=` or to cases where the indirection level matches. ---- 36 / 50 ---- Verdict: IMPROVEMENT (low confidence) Package: https://ftp.debian.org/debian/pool/main/p/povray/povray_3.8.0~beta.2.orig.tar.gz Result: your povray-3.8.0-beta.2/libraries/zlib/deflate.c:1172:21: style: Variable 'strend' can be declared as pointer to const [constVariablePointer] Explanation: In zlib's longest_match, `strend` is only used for pointer comparisons (`scan < strend`) and pointer arithmetic (`strend - scan`, `scan = strend - MAX_MATCH`). Nothing is ever written through it, and `scan` and `match` are also only read through. So a const-qualified pointer fits the code, and the PR's handling of compound assignments like `scan += 2` (pointer arithmetic, not a write through the pointer) plausibly explains the new report. One caveat: `scan` stays a non-const `Bytef*` and is assigned from `strend - MAX_MATCH`. Applying the suggestion alone would produce a C qualifier-discard warning unless `scan` is also made const. ---- 37 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/p/powermanga/powermanga_0.93.1.orig.tar.gz Result: your powermanga-0.93.1/src/gfxroutines.c:192:3: style: Variable 'src' can be declared as pointer to const [constVariablePointer] Explanation: In the COPY2X macro, 'src' is only read through ('*src++') and the pointer itself is advanced ('src += offset_src / sizeof(TYPE)'). The pointed-to data is never written, so 'src' could be declared 'const TYPE *src = (const TYPE *)source;'. Before this PR, the compound assignment 'src += ...' was wrongly treated as changing the pointee, which hid the warning. The PR fixes this, so the new constVariablePointer warning is a true positive. ---- 38 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/p/powermanga/powermanga_0.93.1.orig.tar.gz Result: your powermanga-0.93.1/src/gfxroutines.c:814:3: style: Variable 'src' can be declared as pointer to const [constVariablePointer] Explanation: In the COPY2X_512x440 macro, 'src' is only read through ('*src++') and the pointer itself is advanced ('src += 256'). The data it points to is never written, so 'const TYPE *src' is valid. Before this PR, the compound assignment 'src += 256' was wrongly treated as modifying the pointee, which hid this warning. The new constVariablePointer warning is a true positive. ---- 39 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/p/powermanga/powermanga_0.93.1.orig.tar.gz Result: your powermanga-0.93.1/src/gfxroutines.c:820:3: style: Variable 'src' can be declared as pointer to const [constVariablePointer] Explanation: In COPY2X_512x440(Uint16), 'src' is declared as `Uint16 *src = (Uint16 *)_src;`. It is only read through (`*src++`), and the pointer itself is advanced with `src++` and `src += 256`. The pointee is never written, so it can be `const Uint16 *src`. Before the PR, `src += 256` was wrongly treated as changing the pointed-to data, which hid this warning. The PR fixes that compound-assignment handling, matching the new testother test. The new warning is a true positive. ---- 40 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/r/r-cran-openssl/r-cran-openssl_2.4.2+dfsg.orig.tar.xz Result: your openssl/src/bcrypt/blowfish.c:562:39: style: Parameter 'iv' can be declared as pointer to const [constParameterPointer] Explanation: In blf_cbc_encrypt, 'iv' is only read through (`iv[j]`) and is reassigned with `iv = data`. A non-const `u_int8_t*` converts implicitly to `const u_int8_t*`, so declaring the parameter as pointer to const is valid. Before the PR, the compound assignment `data += 8` on the aliased pointer was wrongly treated as modifying the pointee, which hid this warning. The PR fixes that and adds a test case that matches this pattern (`p = r; r += s;`). The new warning is a true positive. ---- 41 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/s/saga/saga_9.14.2+dfsg.orig.tar.xz Result: your saga-9.14.2/saga-gis/src/tools/grid/grid_gridding/Shepard.cpp:344:11: error: If memory allocation fails: overflow in pointer arithmetic, NULL pointer is subtracted. [nullPointerArithmeticOutOfMemory] saga-9.14.2/saga-gis/src/tools/grid/grid_gridding/Shepard.cpp:131:29: note: Assuming allocation function fails saga-9.14.2/saga-gis/src/tools/grid/grid_gridding/Shepard.cpp:131:15: note: Assignment 'm_cells=(int*)malloc(nr*nr*sizeof(int))', assigned value is 0 saga-9.14.2/saga-gis/src/tools/grid/grid_gridding/Shepard.cpp:145:83: note: Calling function 'qshep2_', 8th argument 'm_cells' value is 0 saga-9.14.2/saga-gis/src/tools/grid/grid_gridding/Shepard.cpp:344:11: note: Null pointer subtraction Explanation: `m_cells` comes from an unchecked `malloc` and is passed as `lcell` to `qshep2_`, which does `lcell -= lcell_offset`. If the allocation fails, this is arithmetic on a NULL pointer, which is undefined behaviour. The trace shows no null check between the malloc at line 131 and the call at line 145. Before the PR, the compound assignment counted as a variable change, so the null value was dropped before the subtraction was checked. The PR now treats `-=` as a read and invalidates the value afterwards, matching its new `p += a` test that expects nullPointerArithmetic. The new warning is therefore a valid true positive, though a pedantic one. ---- 42 / 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/third_party/zstd/lib/dictBuilder/divsufsort.c:551:41: style: Parameter 'last' can be declared as pointer to const [constParameterPointer] Explanation: In ss_rotate, `last` is used in `a = last - 1`, where `a` is a non-const `int*` that is then written through (`*a-- = *b`, `*a = t`). If `last` were declared `const int *`, that assignment would drop the const qualifier, so the code would get a diagnostic in C and would not compile in C++. The suggestion is wrong, so this new constParameterPointer warning is a false positive. It appears because the PR no longer treats compound assignments such as `a -= 1` on the alias as a modification when the indirection is non-zero. ---- 43 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/t/texmaker/texmaker_6.0.1+dfsg.orig.tar.xz Result: your texmaker-6.0.1/3rdparty/pdfium/third_party/libopenjpeg20/dwt.c:755:24: style: Variable 'fl' can be declared as pointer to const [constVariablePointer] Explanation: 'fl' is only read through (fl[0..3]) and reassigned with 'fl = fw'. Reassigning the pointer itself does not modify the pointee, so it can be declared 'const OPJ_FLOAT32* restrict fl'. The warning was previously missed because 'fw += 8' (a compound assignment of the aliased pointer) was treated as a change to the pointed-to data. This is exactly the pattern the PR adds as a test case. It is a new true positive. ---- 44 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/t/texmaker/texmaker_6.0.1+dfsg.orig.tar.xz Result: your texmaker-6.0.1/3rdparty/pdfium/third_party/libopenjpeg20/jp2.c:1079:12: style: Variable 'orig_header_data' can be declared as pointer to const [constVariablePointer] Explanation: `orig_header_data` aliases `p_pclr_header_data` and only stores the starting position. In upstream openjpeg it is used solely in pointer-difference bounds checks like `p_pclr_header_data - orig_header_data`; that later code is not shown here, so this is assumed. Nothing is ever written through it. Main wrongly treated `p_pclr_header_data += 2` as possibly modifying the pointed-to data. That pointer arithmetic does not modify the buffer, which the PR now recognizes. The pointer can be declared `const OPJ_BYTE *`, so this new warning is a true positive. ---- 45 / 50 ---- Verdict: UNCLEAR (low confidence) Package: https://ftp.debian.org/debian/pool/main/t/tiff/tiff_4.7.2.orig.tar.bz2 Result: your libtiff-v4.7.2/tools/tiffdump.c:431:15: style: Variable 'datavalptr' can be declared as pointer to const [constVariablePointer] Explanation: The new warning probably comes from the PR's change to isVariableChanged: a compound assignment such as `dp += sizeof(...)` on an aliased pointer no longer counts as modifying the pointee. That would fit if `datavalptr` is assigned from `dp` or `datamem`, as in the PR's new test. The snippet ends before `datavalptr` is used, though. In tiffdump it may be passed, possibly via casts, to TIFFSwabArrayOf* (which writes in place) or to PrintData. If so, it cannot be pointer-to-const and the warning is a false positive. If it is only read, the warning is correct. Without the later code, the verdict cannot be determined. ---- 46 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/t/trickle/trickle_1.08+ds.orig.tar.xz Result: your trickle-1.08+git20240506+ds/schedule.c:34:8: style: Variable 'place' can be declared as pointer to const [constVariablePointer] Explanation: In the visible code, `place` is only compared with `sched` (`place != sched`) and assigned from it (`place = sched`). It is never dereferenced to write. This is the same pattern as the PR's new test, where `p = r; r += s;`. Before the PR, the compound assignment `sched += 2` / `sched++` was wrongly treated as modifying the data pointed to through `place`, which suppressed this warning. The PR fixes that, so the new constVariablePointer warning looks like a true positive. The rest of the function is not shown, so a later non-const use of `place` (e.g. `&place` passed to strtol) cannot be fully ruled out. ---- 47 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/v/vdr-plugin-fritzbox/vdr-plugin-fritzbox_1.5.8.orig.tar.xz Result: your vdr-plugin-fritzbox-1.5.8/setup.cpp:532:53: performance: Function parameter 'input' should be passed by const reference. [passedByValue] Explanation: In hex2string, 'input' is only read: the iterator is advanced with 'it += 2' and dereferenced only for reading ('it[0]', 'it[1]'). The string itself is never modified. Before the PR, Cppcheck treated the compound assignment on the iterator as a write through it, so it assumed 'input' was modified and stayed silent. The PR stops treating a compound assignment as a change to the pointee. The warning now matches the identical string2hex function, which uses 'it++'. Passing by const reference (with a const_iterator) is valid, so this is a new true positive. ---- 48 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/v/vifm/vifm_0.14.5.orig.tar.gz Result: your vifm-0.14.5/src/ui/escape.c:133:15: error: If memory allocation fails: pointer addition with NULL pointer. [nullPointerArithmeticOutOfMemory] vifm-0.14.5/src/ui/escape.c:112:29: note: Assuming allocation function fails vifm-0.14.5/src/ui/escape.c:112:29: note: Assignment 'no_esc=malloc(len+1)', assigned value is 0 vifm-0.14.5/src/ui/escape.c:113:21: note: Assignment 'no_esc_sym=no_esc', assigned value is 0 vifm-0.14.5/src/ui/escape.c:133:15: note: Null pointer addition Explanation: `no_esc` comes from `malloc(len + 1)` and is never checked for NULL. It is copied into `no_esc_sym`, and on the first loop iteration `no_esc_sym += char_width_esc` adds to a NULL pointer if the allocation failed. That addition is undefined behaviour, so the warning is a true positive. The PR deliberately makes compound assignments like `p += a` keep the null value for checking; the updated test expects exactly this `nullPointerArithmetic` warning. The new report correctly exposes the missing allocation check. ---- 49 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/z/zpaqfranz/zpaqfranz_63.3.orig.tar.gz Result: your zpaqfranz-63.3/ZSFX/libzpaq.cpp:4863:41: style: Parameter 'last' can be declared as pointer to const [constParameterPointer] Explanation: In ss_rotate, `last` cannot be made `const int*`. The code does `a = last - 1`, where `a` is a non-const `int*`, and then writes through it (`*a-- = *b`, `*a = t`). Changing `last` to `const int*` would make `a = last - 1` fail to compile. The PR changed how compound assignments like `a -= 1` / `r += s` are treated for indirect writes, and as a result Cppcheck no longer sees that writing through the alias `a` modifies data reached through `last`. The new constParameterPointer warning is a false positive. ---- 50 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/z/zpaqfranz/zpaqfranz_63.3.orig.tar.gz Result: your zpaqfranz-63.3/zpaqfranz.cpp:18321:41: style: Parameter 'last' can be declared as pointer to const [constParameterPointer] Explanation: In ss_rotate, `last` is used in `a = last - 1`, where `a` is a non-const `int*`, and the code then writes through `a` (`*a-- = *b`, `*a = t`). If `last` were declared `const int*`, `a = last - 1` would not compile. So the parameter cannot be a pointer to const. The new constParameterPointer warning is a false positive. It comes from the PR's narrower handling of assignments in isVariableChanged, which no longer sees that a non-const alias is derived from `last`.