AI review of 2026-11-17_07-00-29-5db5d7f30982-results.txt PR: #9033 https://github.com/cppcheck-opensource/cppcheck/pull/9033 Tested: 5db5d7f30982325da05350e5d229520af2c0482a Merge base: e6188446626b9e3c0cd16ffe0e49c73b18e52793 Reviewed: 2026-11-17 14:10:36 UTC Model: claude-opus-5-5 (effort high) Results: 13 reviewed of 13 in the report Verdicts: 12 acceptable regression, 1 improvement Tokens: 22604 input, 24360 cache read, 2030 cache write, 9795 output The verdicts are written by AI and can be wrong. ---- 1 / 13 ---- Verdict: ACCEPTABLE REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/a/aws-crt-python/aws-crt-python_0.37.0+dfsg.orig.tar.gz Result: main aws-crt-python-0.37.0/crt/aws-c-common/source/byte_buf.c:321:18: style: Variable 'first_char_location' can be declared as pointer to const [constVariablePointer] Explanation: `first_char_location` is only null-checked and used in the pointer difference `first_char_location - working_cur.ptr`. Neither use writes through it, so declaring it `const uint8_t *` is valid and the removed warning was a true positive. The PR is meant to skip `ptr - ptr` (a non-pointer result) without treating it as a write. The warning disappeared probably because of a side effect in the new condition: `hasIncDecPlusMinus` is now set whenever the parent is `-`, even when there is no dereference. That likely sends the variable down a path that marks it non-const, which loses a correct warning (new false negative). ---- 2 / 13 ---- Verdict: ACCEPTABLE REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/a/aws-crt-python/aws-crt-python_0.37.0+dfsg.orig.tar.gz Result: main aws-crt-python-0.37.0/crt/aws-c-common/source/hash_table.c:80:82: style: Parameter 'entry' can be declared as pointer to const [constParameterPointer] Explanation: In `s_index_for`, `entry` is only used in the pointer difference `entry - map->slots`, which computes an index and never modifies the pointee. Declaring the parameter as `const struct hash_table_entry *` is therefore valid, so the removed warning was a true positive. The PR now skips '-' only when the result's valueType is known to be a non-pointer. Here the valueType is probably unknown, likely because the type of `map->slots` comes from a private header, so the usage is now treated as non-const. That creates a false negative. ---- 3 / 13 ---- Verdict: ACCEPTABLE REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/a/aws-crt-python/aws-crt-python_0.37.0+dfsg.orig.tar.gz Result: main aws-crt-python-0.37.0/crt/aws-c-common/source/ring_buffer.c:143:14: style: Variable 'tail_cpy' can be declared as pointer to const [constVariablePointer] Explanation: In the visible code, `tail_cpy` is only assigned from an atomic load (a `void*`). After that it is only compared (`==`, `>`, `<`) and used in pointer subtraction (`tail_cpy - head_cpy`, `tail_cpy - ring_buf->allocation`). Nothing is ever written through it, so declaring it `const uint8_t *` would be valid, and main's constVariablePointer warning looks like a true positive. The PR changed how a `-` parent is handled, and the warning disappeared. That is a new false negative rather than a fixed false positive. Confidence is medium because the end of the function is not shown. ---- 4 / 13 ---- Verdict: ACCEPTABLE REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/a/aws-crt-python/aws-crt-python_0.37.0+dfsg.orig.tar.gz Result: main aws-crt-python-0.37.0/crt/aws-c-common/source/ring_buffer.c:69:14: style: Variable 'tail_cpy' can be declared as pointer to const [constVariablePointer] Explanation: `tail_cpy` is only filled by the atomic load macro (an assignment from a `void*`). In the shown code it is only compared and used in pointer differences such as `tail_cpy - head_cpy - 1`. Nothing is ever written through it, so `const uint8_t *tail_cpy` would be valid and the old warning was a true positive. The PR changed how a binary `-` parent is handled: a `-` is now only skipped when its result is known to be a non-pointer. Here the subtraction result's value type is probably unresolved, so the variable is no longer reported. That makes this a new false negative, not a removed false positive. ---- 5 / 13 ---- Verdict: ACCEPTABLE REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/a/aws-crt-python/aws-crt-python_0.37.0+dfsg.orig.tar.gz Result: main aws-crt-python-0.37.0/crt/aws-c-common/verification/cbmc/sources/make_common_data_structures.c:50:107: style: Parameter 'hi' can be declared as pointer to const [constParameterPointer] Explanation: 'hi' is only compared (`lo < hi`) and used in pointer differences (`hi - lo`, `hi - buf->buffer`). It is never written through and never stored into a non-const pointer, so `const uint8_t *hi` would be valid and the main warning was a true positive. The PR removes '-' from the early-continue list and only skips it when the '-' result has a known non-pointer valueType. Here that check apparently fails, perhaps because the C pointer difference has no valueType, so 'hi' is now treated as possibly non-const. The result is a new false negative. ---- 6 / 13 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/d/di/di_6.2.2.2.orig.tar.gz Result: main di-6.2.2.2/distrutils.c:86:10: style: Variable 'p' can be declared as pointer to const [constVariablePointer] Explanation: `p` is returned as `p - 1` from a function whose return type is `char *`. Making `p` a `const char *` would not compile without a cast. So the old constVariablePointer warning was a false positive. Before the PR, cppcheck skipped any `-` parent, which ignored this use. The PR now treats `p - 1` as a pointer result and follows it to the `return`, so the warning is correctly removed. ---- 7 / 13 ---- Verdict: ACCEPTABLE REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/l/linux-atm/linux-atm_2.5.1.orig.tar.gz Result: main linux-atm-2.5.1/src/ilmid/asn1/exp_buf.c:526:11: style: Variable 'dataPtr' can be declared as pointer to const [constVariablePointer] Explanation: `dataPtr` is set to `data + len`, moved back with `dataPtr = dataPtr - bytesLeft`, and only ever passed as the source argument of `memcpy`. It is never written through, so `const char*` would work and main's warning was a true positive. The PR stops skipping pointer `-` expressions. The result of `dataPtr - bytesLeft` is assigned to a non-const pointer, which now makes the check treat `dataPtr` as non-const and drop the warning. This is a new false negative, not a removed false positive. ---- 8 / 13 ---- Verdict: ACCEPTABLE REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libm/libmawk/libmawk_1.0.5.orig.tar.bz2 Result: main libmawk-1.0.5/scconfig/src/tmpasm/tmpasm_scconfig.c:272:41: style: Variable 'end' can be declared as pointer to const [constVariablePointer] Explanation: `end` is assigned `buff + strlen(buff)` and, as far as the shown code goes, is only read in the pointer difference `end - eopat[0]+1`. Nothing is ever written through it, so declaring it `const char *` would be valid and main's constVariablePointer warning looks like a true positive. The PR now sets `hasIncDecPlusMinus` for `-` and only skips `-` when the result type is known to be a non-pointer. If the type of `eopat` is not resolved here, that type is unknown, so the use is no longer skipped and `end` is treated as possibly non-const. The result is a new false negative, not a removed false positive. Confidence is medium because the rest of the loop after line 312 is not shown. ---- 9 / 13 ---- Verdict: ACCEPTABLE REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/libn/libnbcompat/libnbcompat_20240319.orig.tar.gz Result: main libnbcompat-20240319/regcomp.c:1270:8: style: Variable 'top' can be declared as pointer to const [constVariablePointer] Explanation: `top` is only read: it is assigned `&p->g->sets[...]` and then used in the comparison `cs == top-1`. Neither use writes through the pointer, so `const cset *top` would be valid C, and the removed warning was a true positive. The PR stops skipping every binary `-`. It now only skips `-` when the result is not a pointer. `top-1` is a pointer, so the PR no longer recognizes this pointer-arithmetic-then-compare use as const and drops the warning. This is a new false negative. ---- 10 / 13 ---- Verdict: ACCEPTABLE REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libn/libnginx-mod-rtmp/libnginx-mod-rtmp_1.2.2+dfsg.orig.tar.xz Result: main nginx-rtmp-module-1.2.2/ngx_rtmp_cmd_module.c:202:33: style: Variable 'p' can be declared as pointer to const [constVariablePointer] Explanation: In nginx-rtmp's ngx_rtmp_cmd_connect, `p` is only assigned from `ngx_strlchr(...)`, tested with `if (p)`, and used in `s->app.len = (p - s->app.data)`. None of these write through `p`, so `const u_char *p` would be valid and the old warning was a true positive. The PR makes pointer subtraction set `hasIncDecPlusMinus`. Here the `-` result is not dereferenced, and the new `continue` for non-pointer `-` results apparently does not fire (probably no valueType is set). So the use is now treated as non-const and the true positive is lost. This is a new false negative. The usage is recalled from upstream nginx-rtmp, because the shown excerpt does not include it. ---- 11 / 13 ---- Verdict: ACCEPTABLE REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libn/libnginx-mod-rtmp/libnginx-mod-rtmp_1.2.2+dfsg.orig.tar.xz Result: main nginx-rtmp-module-1.2.2/ngx_rtmp_relay_module.c:853:37: style: Variable 'url_end' can be declared as pointer to const [constVariablePointer] Explanation: `url_end` is only assigned from `ngx_strlchr`, null-checked, and used in the pointer difference `url_end - ctx->url.data`. It is never used to write through, so it could be `const u_char *` and main's warning was a true positive. The PR's new handling of binary '-' drops it. The pointer-difference result's valueType is probably unknown here because nginx types are missing, so the new `pointer == 0` check doesn't fire and the variable is treated as non-const. This is a new false negative. ---- 12 / 13 ---- Verdict: ACCEPTABLE REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/p/pd-ext13/pd-ext13_0.17.1.orig.tar.gz Result: main pd-ext13_0.17.1/openpatch.c:46:13: style: Variable 'lastslash' can be declared as pointer to const [constVariablePointer] Explanation: `lastslash` receives `strrchr(...)` and is then only used in pointer differences (`lastslash - s->s_name`) and as the source argument `lastslash+1` to `strcpy`. Nothing is written through it, so it could be `const char*`, and the removed warning was a true positive. The PR no longer skips every binary `-` unconditionally. It only skips one whose result type is known to be a non-pointer. Here `t_symbol` comes from an unseen Pd header, so `s->s_name` has no known type. The difference therefore has no valueType and is no longer recognized as harmless, and the warning disappears. That is a new false negative, not a new false positive. ---- 13 / 13 ---- Verdict: ACCEPTABLE REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/p/pd-ext13/pd-ext13_0.17.1.orig.tar.gz Result: main pd-ext13_0.17.1/strippath.c:40:13: style: Variable 'lastslash' can be declared as pointer to const [constVariablePointer] Explanation: `lastslash` is never written through. It is only used in `lastslash - s->s_name` (pointer difference), in `lastslash + 1` as the const source argument of strcpy, and in a null check. So it can be `const char *`, and main's warning was a true positive. The PR stops skipping `-` unconditionally and now skips it only when the result's valueType is known to be a non-pointer. Here `s->s_name` comes from m_pd.h, which is likely not resolved, so the difference probably has no known valueType. That makes the check treat the use as non-const and drops a valid warning, which is a new false negative.