AI review of 2026-10-28_11-08-05-76f6fb36b679-results.txt PR: #8819 https://github.com/cppcheck-opensource/cppcheck/pull/8819 Tested: 76f6fb36b679ecc40a6d4d6f45ae4d32ddf1ecae Merge base: ffe7e9be207e201c7b8d6ed5272b931889879a14 Reviewed: 2026-11-13 15:17:44 UTC Model: claude-opus-5-5 (effort high) Results: 50 reviewed of 5555 in the report (random sample), 74 not reviewed: valueFlowMaxIterations Verdicts: 1 acceptable regression, 23 improvement, 24 neutral, 2 regression Tokens: 143246 input, 3712730 cache read, 75770 cache write, 22729 output The verdicts are written by AI and can be wrong. ---- 1 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/6/64tass/64tass_1.60.3243.orig.tar.xz Result: main 64tass-1.60.3243/intobj.c:475:18: style: Condition 'len1+1<1' is always false [knownConditionTrueFalse] Explanation: `len1` is a `size_t`, and `len1 + 1 < 1` is a deliberate overflow check: if `len1 == SIZE_MAX`, then `len1 + 1` wraps to 0 and the condition is true. Main reported 'always false' because it took the lower bound of `len1` and assumed `len1 + 1` cannot wrap. The PR now skips range bounds for unsigned arithmetic that may wrap, so this false positive is gone. ---- 2 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/a/ace/ace_8.0.5+dfsg.orig.tar.gz Result: your ace-8.0.5+dfsg.orig/tests/Compiler_Features_26_Test.cpp:22:20: style: Condition 'a==b' is always false [knownConditionTrueFalse] ace-8.0.5+dfsg.orig/tests/Compiler_Features_26_Test.cpp:22:10: note: Assuming that condition 'a!=b' is not redundant ace-8.0.5+dfsg.orig/tests/Compiler_Features_26_Test.cpp:22:20: note: Condition 'a==b' is always false Explanation: In `!(a!=b) || (a==b)`, the right operand is only evaluated when `!(a!=b)` is false, i.e. when `a!=b` is true. So `a==b` is always false there, and the warning is a correct redundancy finding. The warning text is identical in main and in the PR. The only difference is that the PR's version now carries an error path: the note 'Assuming that condition 'a!=b' is not redundant' points to the condition that implies the result. The PR's `addToErrorPath` changes now propagate condition and path information, which produces these notes. The same warning with an accurate explanation is slightly more useful to users. ---- 3 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/b/brasero/brasero_3.12.4.orig.tar.xz Result: main brasero-3.12.4/libbrasero-media/burn-iso9660.c:264:24: style: Condition 'current_position==-1' is always false [knownConditionTrueFalse] Explanation: `current_position` is a `guint64` initialized to -1, which stores UINT64_MAX. In `current_position == -1`, the -1 is converted to the same unsigned value, so the condition is true on the first loop iteration and the assignment on line 265 runs. Main's claim that the condition is always false was a false positive caused by not modelling the signed/unsigned conversion. The PR's conversion handling removes it. ---- 4 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/b/btyacc/btyacc_3.0+dfsg.orig.tar.gz Result: your btyacc-3.0+dfsg/reader.c:1203:50: style: Condition 'c!='_'' is always true [knownConditionTrueFalse] btyacc-3.0+dfsg/reader.c:1203:26: note: Assuming that condition 'c!='_'' is not redundant btyacc-3.0+dfsg/reader.c:1203:50: note: Condition 'c!='_'' is always true Explanation: Line 1203 checks `c != '_'` twice: `!isalpha(c) && c != '_' && c != '.' && c != '_'`. The second check at column 50 is always true because the first `c != '_'` (column 26) has already been evaluated under `&&`. So the warning is a true positive on the duplicated condition in both versions. The only change is that the PR's output now carries an error path: a note pointing at the earlier `c!='_'` at 1203:26 that makes the second one redundant. The finding is the same and the message is more informative. ---- 5 / 50 ---- Verdict: NEUTRAL (high confidence) Package: https://ftp.debian.org/debian/pool/main/c/catgirl/catgirl_2.2a.orig.tar.gz Result: main catgirl-2.2a/irc.c:153:7: style: Condition 'error' is always true [knownConditionTrueFalse] Explanation: The same knownConditionTrueFalse warning at irc.c:153 is reported by both main and the PR. Only the extra 'note' lines differ, so this is a change in message formatting or error path. On line 152, 'if (!error) break;' makes 'error' always true on line 153, so the warning is a true positive in both versions. The added notes give supporting context but do not change what is reported. ---- 6 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/c/cmucl/cmucl_21d.orig.tar.bz2 Result: main src/lisp/lisp.c:173:17: style: Condition '*argv0_dir!='\0'' is always true [knownConditionTrueFalse] Explanation: This is a true positive in both versions. The inner `if (*argv0_dir != '\0')` sits inside the `else if (*argv0_dir != '\0')` branch, so it is always true. The PR keeps the same warning text and severity and only adds an error-path note pointing at the outer condition. That note shows where the fact comes from, but its wording ('Assuming that condition ... is not redundant') is a bit odd for a certain fact. The diagnostic is essentially unchanged for users. ---- 7 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/c/cmus/cmus_2.12.0.orig.tar.gz Result: main cmus-2.12.0/op/jack.c:496:74: style: Condition 'channel_map[c]==CHANNEL_POSITION_MONO' is always false [knownConditionTrueFalse] Explanation: The warning itself is correct. If channel_map[c] were MONO, the first `if` on line 494 would already have been taken, so the second MONO check on line 496 can never be true. The 'main' line is the same warning without any notes. The 'your' version adds notes explaining the reasoning ('Assuming that condition ... is not redundant' at line 494). The same true positive is still reported, now with a more informative error path, which counts as a more accurate message. ---- 8 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/c/comedilib/comedilib_0.11.0+5.orig.tar.gz Result: main comedilib-0.11.0/lib/calib.c:177:7: style: Condition 'name' is always true [knownConditionTrueFalse] Explanation: Both versions report the same true positive: inside `while ((name = strchr(name, '/')))`, the inner `if (name)` is always true because the loop condition already guarantees `name` is non-null. The warning text, location and severity are unchanged. Only the error path differs: the PR attaches the loop condition's `condition` to the value, so a note appears. That note adds a little context, but its 'Assuming ... is not redundant' wording fits a loop guard poorly. Overall this does not matter to users. ---- 9 / 50 ---- Verdict: NEUTRAL (low confidence) Package: https://ftp.debian.org/debian/pool/main/c/critterding/critterding_1.0-beta14+dfsg.orig.tar.xz Result: your critterding-beta14/src/scenes/critterding/entities/worldb.cpp:2154:25: style: Condition 'm_map.get()' is always true [knownConditionTrueFalse] critterding-beta14/src/scenes/critterding/entities/worldb.cpp:2154:7: note: Assuming that condition 'm_map' is not redundant critterding-beta14/src/scenes/critterding/entities/worldb.cpp:2154:25: note: Condition 'm_map.get()' is always true Explanation: Both main and the PR report the same warning, 'Condition m_map.get() is always true', at the same location. In `m_map && m_map.get()`, the smart pointer `m_map` has already been tested as non-null, so `m_map.get()` is indeed always true. The warning is a true positive either way. The diff entry most likely reflects only a difference in the attached notes or error path, which cannot be compared because main's notes are not shown. Nothing visible changes for users. ---- 10 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/c/cyrus-imapd/cyrus-imapd_3.12.4.orig.tar.xz Result: main cyrus-imapd-3.12.4/imap/backend.c:857:25: style: Condition 'old_mechlist' is always true [knownConditionTrueFalse] Explanation: At line 857 the condition `old_mechlist` is checked inside a block that is only entered when `new_mechlist && old_mechlist && strcmp(...)` is true, so `old_mechlist` is non-null there and the warning is a true positive. The 'main' line has no supporting notes and is replaced by an identical 'your' warning that now includes the error path ("Assuming that condition 'old_mechlist' is not redundant" at 851). The message is the same but now explains why the condition is always true, which makes it more useful. ---- 11 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/f/feedreader/feedreader_2.10.0.orig.tar.gz Result: your FeedReader-2.10.0/libraries/libnxml/nxml_write.c:278:8: style: Condition '!data->children' is always false [knownConditionTrueFalse] FeedReader-2.10.0/libraries/libnxml/nxml_write.c:266:10: note: Assuming that condition 'data->children' is not redundant FeedReader-2.10.0/libraries/libnxml/nxml_write.c:276:18: note: Assuming condition is true FeedReader-2.10.0/libraries/libnxml/nxml_write.c:278:8: note: Condition '!data->children' is always false Explanation: Both versions report the same true positive. Inside `if (data->children)`, `data->children` is not reassigned before line 278, so `!data->children` is always false. The only visible difference is the error-path notes. The PR version adds a note 'Assuming condition is true' for `data->type == NXML_TYPE_ELEMENT` at line 276. That note is not really relevant to why `!data->children` is false, but it is harmless and does not change the warning's correctness or meaning. This is effectively a cosmetic change in the trace. ---- 12 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/g/gcc-h8300-hms/gcc-h8300-hms_3.4.6+dfsg2.orig.tar.gz Result: main gcc-h8300-hms-3.4.6+dfsg2/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/1.cc:43:21: error: Out of bounds access in 'str01[csz01]', if 'str01' size is 21 and 'csz01' is 21 [containerOutOfBounds] gcc-h8300-hms-3.4.6+dfsg2/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/1.cc:40:21: note: Assignment 'csz01=str01.size()', assigned value is 21 gcc-h8300-hms-3.4.6+dfsg2/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/1.cc:43:21: note: Access out of bounds Explanation: Line 43 reads `str01[csz01]` where `csz01 == str01.size()` and `str01` is a const std::wstring. For `basic_string`, `operator[](size())` is well-defined: it returns a reference to the terminating `charT()`, guaranteed for the const overload even in C++98 and for both overloads since C++11. The test even checks `cref2 == wchar_t()`. So the containerOutOfBounds warning was a false positive, and removing it is an improvement. The removal may come from incidental changes in how the PR propagates assigned values rather than from deliberate string modelling, hence medium confidence. ---- 13 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/g/global/global_6.6.14.orig.tar.gz Result: main global-6.6.14/libltdl/ltdl.c:2434:11: style: Condition 'cur' is always true [knownConditionTrueFalse] Explanation: Both main and the PR report the same warning, 'Condition cur is always true', at ltdl.c:2434. Only the attached note/error path differs. The warning is a true positive: the loop body runs only when `handle = lt_dlhandle_iterate(...)` is non-null, and `cur = handle`, so `cur` is always non-null there. The PR's version carries a clear error path (assumed loop condition, then the assignment to `cur`). The user-visible diagnostic is essentially unchanged. ---- 14 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/g/gpsim/gpsim_0.32.1.orig.tar.gz Result: main gpsim-0.32.1/modules/usart.cc:1024:9: style: Condition 'm_txreg' is always true [knownConditionTrueFalse] Explanation: The same warning at usart.cc:1024 is reported by both main and your. The only difference is the attached notes, and the diff lists the 'your' version with its notes, so this 'main' line is the same diagnostic with a different rendering. The warning itself is correct: if m_txreg were null, '!m_txreg' at line 984 would take the if-branch, so in the else branch m_txreg is non-null. The pair is unchanged in substance, so it is neutral. ---- 15 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/g/guidedog/guidedog_1.3.0.orig.tar.gz Result: your guidedog-1.3.0/guidedog.cpp:1489:14: style: Condition 'rule!=0' is always true [knownConditionTrueFalse] guidedog-1.3.0/guidedog.cpp:1488:12: note: Assignment 'rule=&(doc->forwardrulelist[i])', assigned value is never 0 guidedog-1.3.0/guidedog.cpp:1489:14: note: Condition 'rule!=0' is always true Explanation: The warning is reported by both main and the PR at the same location with the same text. Only the attached notes appear to differ in the diff output. The code takes the address of an element, `&(doc->forwardrulelist[i])`, which cannot be null, so 'rule!=0' is always true. The warning is a true positive in both versions, and the change has no meaningful effect for users. ---- 16 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/h/haskell-libbf/haskell-libbf_0.6.8.orig.tar.gz Result: main libBF-0.6.8/libbf-quickjs-2021-03-27/libbf.c:4963:15: style: Condition 'e<-(prec+2)' is always true [knownConditionTrueFalse] libBF-0.6.8/libbf-quickjs-2021-03-27/libbf.c:4960:17: note: Assuming that condition 'a->expn<0' is not redundant libBF-0.6.8/libbf-quickjs-2021-03-27/libbf.c:4962:25: note: Assignment 'e=2*a->expn-1', assigned value is less than -2 libBF-0.6.8/libbf-quickjs-2021-03-27/libbf.c:4963:15: note: Condition 'e<-(prec+2)' is always true Explanation: `e` is `slimb_t` (signed) and `prec` is `limb_t` (unsigned), so `e < -(prec+2)` is a 64-bit unsigned comparison. Converted to unsigned, a negative `e` and `-(prec+2)` keep their mathematical order, so the result depends on whether `e` is below `-(prec+2)`, which depends on `prec`. Knowing only that `e < -2` cannot make the condition always true. Main's knownConditionTrueFalse was a false positive, and the PR's handling of signed/unsigned common types and value ranges removes it. ---- 17 / 50 ---- Verdict: NEUTRAL (low confidence) Package: https://ftp.debian.org/debian/pool/main/i/inchi/inchi_1.07.3+dfsg.orig.tar.xz Result: your InChI-1.07.3/INCHI-1-SRC/INCHI_API/demos/inchi_main/src/e_mol2atom.c:569:24: style: Condition 'pOnlyHeaderBlock' is always true [knownConditionTrueFalse] InChI-1.07.3/INCHI-1-SRC/INCHI_API/demos/inchi_main/src/e_mol2atom.c:568:26: note: Assuming that condition '!pOnlyHeaderBlock' is not redundant InChI-1.07.3/INCHI-1-SRC/INCHI_API/demos/inchi_main/src/e_mol2atom.c:569:24: note: Condition 'pOnlyHeaderBlock' is always true Explanation: Both main and the PR report the same 'pOnlyHeaderBlock is always true' warning at line 569; only the attached notes differ. In both versions the warning is a false positive. pOnlyHeaderBlock is evaluated only when mol_data is NULL. In that case the first ternary condition is false whatever pOnlyHeaderBlock is, so nothing is learned about it. pOnlyHeaderBlock is NULL whenever `at` is non-NULL, so it is not always true. The PR changes the error path, adding an 'Assuming that condition '!pOnlyHeaderBlock' is not redundant' note, but the false positive is neither fixed nor newly introduced. It is unclear whether the new notes are more or less helpful than main's, so the overall effect is neutral. ---- 18 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/i/indi/indi_2.2.5+dfsg.orig.tar.xz Result: main indi-2.2.5/libs/indibase/webcam/v4l2_colorspace.c:21:25: error: Undefined behaviour: float (278.288) to integer conversion overflow. [floatConversionOverflow] indi-2.2.5/libs/indibase/webcam/v4l2_colorspace.c:19:19: note: Assuming that condition 'i<256' is not redundant indi-2.2.5/libs/indibase/webcam/v4l2_colorspace.c:21:25: note: float to integer conversion Explanation: Line 21 computes `(unsigned char)((255.0/219.0)*(i-16))` with `unsigned int i` running from 0 to 255. The removed main warning (278.288, at i=255) is a true positive: converting a float above 255 to unsigned char is undefined behaviour. The PR does not drop the finding; it re-reports the same line with 5.00099e+09. That value is also real: on the first iteration i=0, so `i-16` wraps to 4294967280, which times 1.164 is about 5.0e9. The new message points to the definite first-iteration value via 'i=0' rather than an assumed loop-bound condition. It also exposes the unsigned wraparound, which is the less obvious bug. Both messages are correct, and the new one is somewhat more precise and informative. ---- 19 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/k/kalarmcal/kalarmcal_20.08.3.orig.tar.xz Result: your kalarmcal-20.08.3/src/kadatetime.cpp:728:19: style: Comparing expression of type 'signed int' against value 2147483648. Condition is always false. [compareValueOutOfTypeRangeError] Explanation: In kalarmcal, `InvalidOffset` is declared as `static const int InvalidOffset = 0x80000000;`. The literal has type unsigned int, but storing it in an `int` converts it to INT_MIN (-2147483648). So `offset == InvalidOffset` is an int-to-int comparison against a value that is in range and can be true: the code deliberately uses it as a sentinel. The PR now gives InvalidOffset the unconverted value 2147483648 and claims the condition is always false. That is a new false positive caused by worse value tracking, and the same mistake shows up at all the other new sites in this file. ---- 20 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/liba/libabigail/libabigail_3.0.orig.tar.xz Result: your libabigail-3.0/src/abg-suppression.cc:3301:8: style: Condition 'fn_parm' is always true [knownConditionTrueFalse] libabigail-3.0/src/abg-suppression.cc:3297:8: note: Assuming that condition '!fn_parm' is not redundant libabigail-3.0/src/abg-suppression.cc:3301:8: note: Condition 'fn_parm' is always true Explanation: The same warning (line 3301, `fn_parm` always true after `if (!fn_parm) return false;`) appears on both the main and your side. It is a true positive, because the earlier check already returned when fn_parm was null. Only the attached notes/error path differ. In this package every warning shows up as a matching main/your pair, so this is most likely just a change in how the error path or notes are printed. The notes themselves are accurate, so there is no real effect for users. ---- 21 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libd/libdsk/libdsk_1.5.9+dfsg.orig.tar.xz Result: your libdsk-1.5.9/lib/dskwrite.c:105:13: style: Condition 'self' is always true [knownConditionTrueFalse] libdsk-1.5.9/lib/dskwrite.c:101:13: note: Assuming that condition '!self' is not redundant libdsk-1.5.9/lib/dskwrite.c:105:13: note: Condition 'self' is always true Explanation: Line 101 returns early when self is NULL, so 'self' really is non-null at line 105 and the knownConditionTrueFalse warning is a true positive. The warning text is the same in main and in the PR. The only difference is that the PR version now shows the supporting notes, pointing to the '!self' check at line 101. This makes the explanation of the warning more accurate. ---- 22 / 50 ---- Verdict: NEUTRAL (low confidence) Package: https://ftp.debian.org/debian/pool/main/libl/liblc3/liblc3_1.1.3+dfsg.orig.tar.xz Result: main liblc3-1.1.3/src/lc3.c:82:26: style: Condition 'hz==48000' is always false [knownConditionTrueFalse] Explanation: The same knownConditionTrueFalse warning at line 82 is reported by both versions. The PR only adds an error path note pointing at the identical `hz==48000` test on line 81. That warning looks like a false positive either way. When `hrmode` is true, line 81 short-circuits at `!hrmode`, so `hz` is unconstrained at line 82 and `hrmode && hz == 48000` can be true. The PR neither fixes nor introduces the false positive. It only changes the attached notes, which explain the existing (wrong) reasoning. This makes no practical difference to users. ---- 23 / 50 ---- Verdict: NEUTRAL (low confidence) Package: https://ftp.debian.org/debian/pool/main/libm/libmeshb/libmeshb_7.80.orig.tar.gz Result: main libMeshb-7.80/examples/mesh2poly.c:183:10: style: Condition 'NmbTet' is always true [knownConditionTrueFalse] Explanation: The warning is reported by both versions; only the error path differs. NmbTet is a local count that is not modified inside `if(NmbTet)` at line 168, so the inner `if(NmbTet)` at line 183 is genuinely always true. The new note pointing at the outer condition on line 168 is accurate, but main's error path is not shown, so we cannot tell whether it was worse. The warning itself is unchanged, so the effect on users is negligible. ---- 24 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libr/librecad/librecad_2.2.0.2.orig.tar.gz Result: main LibreCAD-2.2.0.2/librecad/src/test/lc_simpletests.cpp:642:7: style: Condition '!graphic' is always false [knownConditionTrueFalse] Explanation: The warning itself did not go away. It is still reported on the same line with the same text. The only change is that the PR's version now includes a note chain: 'Assuming that condition d is not redundant', then 'Assignment graphic=(RS_Graphic*)d, assigned value is never 0'. The main version had no such explanation. The warning is a true positive: inside `if (d)`, `graphic` is a C-style cast of `d`, so it cannot be null and `!graphic` is always false. Explaining why the condition is always false makes the message more useful, so this is a small improvement, or at worst neutral. ---- 25 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libs/libscca/libscca_20250915.orig.tar.gz Result: main libscca-20250915/libcdata/libcdata_range_list.c:4083:23: style: Condition 'range_list_value==NULL' is always false [knownConditionTrueFalse] Explanation: The same knownConditionTrueFalse warning at 4083 is still reported by the PR build, so it was not really removed; most likely only its note/error-path lines changed. The warning itself is correct. `range_list_value` is a pointer parameter that was already checked for NULL at line 4041 (returning early) and is never reassigned. So `range_list_value == NULL` at 4083 is always false; the author probably meant `*range_list_value`. Nothing changes for users in practice. ---- 26 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libv/libvisual/libvisual_0.4.2.orig.tar.gz Result: main libvisual-0.4.2/libvisual/lv_audio.c:980:26: style: Condition 'dest->format==VISUAL_AUDIO_SAMPLE_FORMAT_FLOAT' is always false [knownConditionTrueFalse] Explanation: Both versions report the same true positive. Line 980 is only reached when the first branch at line 968 (dest->format == FLOAT) was not taken, so 'dest->format==VISUAL_AUDIO_SAMPLE_FORMAT_FLOAT' really is always false there. The PR version adds an error path that points back to the line 968 check, which explains why the condition is false. The note about line 974 is not strictly needed but does no harm. The warning is unchanged and now easier to understand. ---- 27 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libv/libvsgpt/libvsgpt_0~20240504.orig.tar.gz Result: your libvsgpt-20240504/libcdata/libcdata_array.c:827:35: style: Condition 'internal_array->entries!=NULL' is always true [knownConditionTrueFalse] libvsgpt-20240504/libcdata/libcdata_array.c:731:30: note: Assuming that condition 'internal_array->entries==NULL' is not redundant libvsgpt-20240504/libcdata/libcdata_array.c:742:24: note: Assuming condition is false libvsgpt-20240504/libcdata/libcdata_array.c:823:29: note: Assuming condition is false libvsgpt-20240504/libcdata/libcdata_array.c:827:35: note: Condition 'internal_array->entries!=NULL' is always true Explanation: Both main and the PR report the same warning at line 827. In this resize function, line 731 returns early when `internal_array->entries == NULL`, so `entries != NULL` really is always true at line 827, and the warning is a true positive in both versions. Only the attached note chain (the error path) differs. The new path (731 → 742 → 823 → 827) is plausible, but main's notes are not shown, so the new path cannot be shown to be better or worse. Either way, the user-visible finding is unchanged. ---- 28 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/libw/libwpd/libwpd_0.10.3.orig.tar.xz Result: your libwpd-0.10.3/src/lib/WP42Heuristics.cpp:143:51: warning: Either the condition 'readVal>=(unsigned char)0x80' is redundant or the array 'WP42_FUNCTION_GROUP_SIZE[63]' is accessed at index -65, which is out of bounds. [negativeIndex] libwpd-0.10.3/src/lib/WP42Heuristics.cpp:103:20: note: Assuming that condition 'readVal>=(unsigned char)0x80' is not redundant libwpd-0.10.3/src/lib/WP42Heuristics.cpp:143:51: note: Negative array index Explanation: `readVal` is an unsigned char. The final `else` branch is reached only after the earlier branches have handled the lower values (presumably everything below 0x80, judging by the warning's -65 = 0x7F - 0xC0), 0x80..0xBF, and >=0xFF. So inside that branch `readVal` is 0xC0..0xFE, and `readVal-0xC0` is 0..62, which is within bounds of the 63-element array. The warning assumes `readVal` can be 0x7F here, which ignores the else-if chain. The PR adds this false positive, so it is a regression. ---- 29 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/n/nbsdgames/nbsdgames_6.0.3.orig.tar.gz Result: main nbsdgames-6.0.3/src/redsquare.c:891:44: style: Condition 'input=='!'' is always false [knownConditionTrueFalse] Explanation: Line 891 is `input=='!' || (input==KEY_F(2)||input=='!')`. The second `input=='!'` can only be evaluated when the first one was false, so it is always false. The warning is a true positive. Main and the PR both report it with identical text. The PR only adds an error-path note ('Assuming that condition input=='!' is not redundant' pointing at the first comparison). That note is correct and a little more helpful, but the diagnostic is otherwise unchanged, so this does not matter much to users either way. ---- 30 / 50 ---- Verdict: NEUTRAL (low confidence) Package: https://ftp.debian.org/debian/pool/main/n/netrek-client-cow/netrek-client-cow_3.3.3.orig.tar.gz Result: your netrek-client-cow-3.3.3/socket.c:1213:52: style: Condition 'size==0' is always false [knownConditionTrueFalse] netrek-client-cow-3.3.3/socket.c:1174:50: note: Assuming that condition 'handlers[(unsigned char)*bufptr].size==0' is not redundant netrek-client-cow-3.3.3/socket.c:1192:47: note: Assignment 'size=handlers[(unsigned char)*bufptr].size', assigned value is never 0 netrek-client-cow-3.3.3/socket.c:1213:52: note: Condition 'size==0' is always false Explanation: Both main and the PR report the same warning, so only the error-path notes differ. The warning is a true positive. Line 1174 returns early when `handlers[...].size == 0`, and line 1192 assigns that nonzero size. The SHORT_PACKETS branch returns if `size <= 0`, and nothing in the loop changes `size` before line 1213. So `size == 0` there is always false; the check is defensive dead code. The new notes ('Assuming ... size==0 is not redundant', 'assigned value is never 0') are accurate. Main's notes are not shown, so we cannot tell whether the message got better or worse; for users the effect is essentially unchanged. ---- 31 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/o/ocrad/ocrad_0.29.orig.tar.gz Result: main ocrad-0.29/feats.cc:121:44: warning:inconclusive: Array index -1 is out of bounds. [negativeContainerIndex] ocrad-0.29/feats.cc:101:18: note: Assignment 'i=0', assigned value is 0 ocrad-0.29/feats.cc:117:51: note: Assignment 'end=(seg.size()<=limit)?i-1:i', assigned value is -1 ocrad-0.29/feats.cc:121:44: note: Negative array index Explanation: The removed warning claims `segv[end]` at line 121 is accessed with index -1. That cannot happen. The access is guarded by `begin <= end`, and `begin` is never negative: it is set from `i >= 0` and only ever incremented. So if `end` were -1, short-circuit evaluation would skip `segv[end]`. In addition, `end = i - 1` with `i = 0` is unreachable. Case 1 can only be reached at `i == 0` after case 0 has confirmed `seg.size() > limit`, so at that point `end = i = 0`. The warning was a false positive (marked inconclusive), and the PR removing it is an improvement. ---- 32 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/o/ogmrip/ogmrip_1.0.1.orig.tar.gz Result: main ogmrip-1.0.1/libogmrip/ogmrip-x264.c:277:7: warning: %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'. [invalidPrintfArgType_uint] Explanation: `x264->merange` is almost certainly a `guint` field, as the other x264 fields printed with `%u` appear to be. `CLAMP(x264->merange, 4, 16)` expands to nested ternaries that mix `unsigned int` with the int literals 4 and 16. The usual arithmetic conversions therefore make the whole expression `unsigned int`, which matches `%u`. Main's old ternary typing kept the operand's `int` type, ignoring signedness, so it reported `signed int`. That was a false positive. The PR now computes the common integral type, so the removal is correct. The new `%d`/unsigned warnings at lines 321 and 330 are consistent with this. ---- 33 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/o/opencascade/opencascade_7.9.2+dfsg.orig.tar.xz Result: main occt-V7_9_2/src/OSD/OSD_Path.cxx:730:23: style: Condition 'length==1' is always false [knownConditionTrueFalse] Explanation: The line at 730 is not really gone. Main reported 'length==1' is always false with no error path. The PR reports the same warning at the same location and adds notes: the condition 'length!=1' at line 725 and the assumption at line 727. The warning is a true positive, since the outer `if (length != 1)` guards the inner check. The new message explains why the condition is always false, so it is more accurate. ---- 34 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/p/pchar/pchar_1.5.orig.tar.gz Result: main pchar-1.5/ResultTable.cc:583:9: style: Condition 'ys==NULL' is always false [knownConditionTrueFalse] Explanation: The warning is still reported. Only its text changed: the PR version adds a note chain. That chain is odd: it says ys has the symbolic value residuals, which comes from treating the two allocations as related. Still, the conclusion is true. ys comes from plain `new double[maxValues]`, which never returns NULL, so the check is always false either way. Main showed the same warning with no path notes, while the PR version shows the assumption and the assignment trail. The verdict is a mild improvement because the extra error-path information helps users, though the note wording is questionable. ---- 35 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/p/pmw/pmw_5.22.orig.tar.gz Result: main pmw-5.22/src/setslur.c:805:18: style: Condition 's->gaps!=NULL' is always true [knownConditionTrueFalse] Explanation: Both main and the PR report the same warning at setslur.c:805 ('s->gaps!=NULL' is always true). Only the attached note/error-path text differs, so the user-visible finding is unchanged. The warning itself looks like a false positive in both versions: the loop body presumably unlinks gaps from the list until it is empty, so the condition is only true on the first iteration. The PR neither fixes nor worsens it. ---- 36 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/p/procps/procps_4.0.7.orig.tar.xz Result: your procps-4.0.7/src/pmap.c:351:8: style: Condition '!ret' is always false [knownConditionTrueFalse] procps-4.0.7/src/pmap.c:335:13: note: Assuming that condition 'ret!=NULL' is not redundant procps-4.0.7/src/pmap.c:345:15: note: Assuming condition is false procps-4.0.7/src/pmap.c:351:8: note: Condition '!ret' is always false Explanation: Both main and the PR report the same knownConditionTrueFalse at pmap.c:351, and it is a true positive. Inside `while (ret != NULL)`, the `fgets` call at line 350 discards its return value, so `ret` is never reassigned before the `!ret` check. That makes `!ret` always false, which is a real bug: the code should check `fgets`' return value. The PR only changes the attached error-path notes (assuming `ret!=NULL` from the loop condition). These notes are accurate, but main's notes are not shown, so this cannot be judged a clear improvement. The warning itself is unchanged. ---- 37 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/p/proftpd-dfsg/proftpd-dfsg_1.3.9e~dfsg.orig.tar.gz Result: main proftpd-1.3.9e/lib/pr_fnmatch_loop.c:1030:41: style: Condition 'n!=string_end' is always true [knownConditionTrueFalse] Explanation: Both main and the PR report the same knownConditionTrueFalse warning at line 1030 with identical text; the main/your pair most likely differs only in the attached notes. The warning is a true positive: line 1027 returns when n == string_end, so 'n != string_end' at line 1030 is always true. Because the warning is still reported, the change makes no practical difference to users. ---- 38 / 50 ---- Verdict: ACCEPTABLE REGRESSION (low confidence) Package: https://ftp.debian.org/debian/pool/main/p/proftpd-mod-proxy/proftpd-mod-proxy_0.9.7.orig.tar.gz Result: main proftpd-mod_proxy-0.9.7/lib/proxy/conn.c:1911:17: style: Condition 'tlv_len>0' is always true [knownConditionTrueFalse] proftpd-mod_proxy-0.9.7/lib/proxy/conn.c:1558:50: note: Assignment 'total_len=sizeof(uint8_t)+sizeof(uint16_t)+tlv_valsz', assigned value is greater than 2 proftpd-mod_proxy-0.9.7/lib/proxy/conn.c:1910:29: note: Calling function 'add_v2_tlv_tls' returns !<=2 proftpd-mod_proxy-0.9.7/lib/proxy/conn.c:1911:17: note: Condition 'tlv_len>0' is always true Explanation: Main warned because `add_v2_tlv_tls()` sets `total_len = sizeof(uint8_t) + sizeof(uint16_t) + tlv_valsz` (3 + tlv_valsz) and appears to always return it, so `tlv_len > 0` at line 1911 looks always true. In practice the check is defensive and the warning is plausibly a true style positive. The PR stops trusting lower bounds on unsigned arithmetic that might wrap, and on truncation into the uint16_t `total_len`. Cppcheck therefore no longer derives the `!<=2` return value and drops the warning. In theory a very large `tlv_valsz` could wrap the 16-bit result, but that is not realistic here, so this is most likely a lost true positive caused by more conservative wrap handling. Confidence is low because the body of `add_v2_tlv_tls()` (and whether it has other return paths) is not shown. ---- 39 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/p/pulseeffects/pulseeffects_4.8.7.orig.tar.gz Result: main easyeffects-4.8.7/src/convolver/gstpeconvolver.cpp:295:36: style: Condition 'peconvolver->kernel_path!=nullptr' is always true [knownConditionTrueFalse] Explanation: The same knownConditionTrueFalse warning is reported at the same location by both versions; only the attached error-path notes differ. The warning is a true positive: `value != nullptr` is checked at line 285, and `kernel_path = value` is assigned at line 293, so the check at line 295 is always true. The PR's version has a correct and clear error path (assuming the condition at 285 is true, the assigned value is never 0). Main's notes are not shown, so we cannot tell whether the explanation got better or worse. The user-visible finding is unchanged. ---- 40 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/r/r-base/r-base_4.6.1.orig.tar.xz Result: main R-4.6.1/src/main/radixsort.c:575:35: error: Signed integer overflow for expression '-2147483647-1'. [integerOverflow] Explanation: INT_MIN expands to (-2147483647-1). In C that expression is well-defined: -2147483647 minus 1 equals INT_MIN, which fits in int, so no overflow happens. The subtraction `(unsigned int)xsub[i] - INT_MIN` is also unsigned arithmetic. The old warning came from bad value/type handling of the constant expression or the implicit conversion. The PR reworks implicit conversion truncation and common integral type computation, which removes this false positive. ---- 41 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/r/r-bioc-dada2/r-bioc-dada2_1.40.0+dfsg.orig.tar.xz Result: main dada2/src/kmers.cpp:255:25: warning:inconclusive: Either the condition 'kord==NULL' is redundant or there is possible null pointer dereference: kord. [nullPointerRedundantCheck] dada2/src/kmers.cpp:254:12: note: Assuming that condition 'kord==NULL' is not redundant dada2/src/kmers.cpp:255:25: note: Null pointer dereference Explanation: Line 254 calls `Rcpp::stop()` when `kord == NULL`. `Rcpp::stop` throws an exception and never returns, so `kord` cannot be NULL at the dereference on line 255. The removed nullPointerRedundantCheck was therefore a false positive, already marked inconclusive because Cppcheck did not know `stop` is noreturn. The PR probably dropped it through changed loop/valueflow handling (the int `i` compared with size_t `klen`) rather than better noreturn knowledge. Even so, losing this false positive helps users. ---- 42 / 50 ---- Verdict: NEUTRAL (high confidence) Package: https://ftp.debian.org/debian/pool/main/r/radare2/radare2_6.1.8+ds.orig.tar.xz Result: main radare2-6.1.8+ds/libr/bin/format/som/som.c:526:10: style: Condition 'obj->dl_strings' is always true [knownConditionTrueFalse] Explanation: The warning itself did not change. Main and your both report 'obj->dl_strings' is always true at line 526. The only difference is that the PR version adds notes, and those notes are not part of the diffed main line. The warning is a true positive: line 515 returns early when !obj->dl_strings, and nothing in between modifies dl_strings. Same message on both sides, so this is effectively neutral. ---- 43 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/r/rulex/rulex_3.9.2.orig.tar.gz Result: main rulex-3.9.2/src/lexdb.c:1211:33: style: Condition '(int)inVal.mv_size<0' is always false [knownConditionTrueFalse] rulex-3.9.2/src/lexdb.c:1210:19: note: Assignment 'inVal.mv_size=(unsigned long)pack_data(key,value,packed_data)', assigned value is greater than -1 rulex-3.9.2/src/lexdb.c:1211:33: note: Condition '(int)inVal.mv_size<0' is always false Explanation: pack_data returns an int that can be negative (e.g. -1 for an error). It is converted to size_t and stored, then cast back to signed int and compared with 0. A negative return becomes a huge size_t, which casts back to a negative int, so the condition `(int)inVal.mv_size < 0` can be true and is the intended error check. Main wrongly kept the 'greater than -1' (impossible <=-1) fact of the unsigned value through the (int) narrowing cast and reported the condition as always false. That was a false positive. The PR's cast-range handling drops impossible ranges that do not survive the conversion, which removes it. ---- 44 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/s/samtools/samtools_1.24.orig.tar.gz Result: your samtools-samtools-5c0ff84/consensus_pileup.c:391:31: style: Condition 'phead' is always true [knownConditionTrueFalse] samtools-samtools-5c0ff84/consensus_pileup.c:384:29: note: Assuming that condition 'phead' is not redundant samtools-samtools-5c0ff84/consensus_pileup.c:391:31: note: Condition 'phead' is always true Explanation: Same warning before and after; only the message changed. The new message adds a note pointing at line 384, where the loop condition `while (col < pos && phead)` guarantees that `phead` is non-null. That makes the warning easier to understand. The warning itself is a true positive: inside the loop body, before `phead` is modified, `phead ? phead->next : NULL` always takes the true branch. ---- 45 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/s/sudo/sudo_1.9.17p2.orig.tar.gz Result: main sudo-1.9.17p2/lib/zlib/compress.c:50:41: style: Condition 'sourceLen>(uLong)max' is always true [knownConditionTrueFalse] Explanation: sourceLen is an unknown uLong parameter that is decremented in the loop. Whether 'sourceLen > (uLong)max' holds depends on the input size, so the condition is not always true. The warning in main was a false positive, probably caused by wrong value propagation through the uInt/uLong casts or the unsigned subtraction. The PR adds unsigned-wrap and conversion handling, which removes it, and the sibling false positives in compress.c and uncompr.c disappear the same way. ---- 46 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/s/systemd-udeb/systemd-udeb_262.orig.tar.gz Result: main systemd-262/src/test/test-alloc-util.c:138:13: style: Pointer expression 'cp' converted to bool is always true. [knownPointerToBool] Explanation: Both main and the PR report the same knownPointerToBool warning at line 138. Only the attached note/error path differs, and the PR version shows 'cp=&c, assigned value is never 0'. The warning itself is correct: `cp` is `&c`, so converting it to bool is always true, which this test does deliberately. The main version's notes are not shown, so we cannot tell whether the new path is more or less accurate. The change does not matter to users either way. ---- 47 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/t/tetgen/tetgen_1.6.0+dfsg1.orig.tar.gz Result: your tetgen-1.6.0+dfsg1/tetgen.cxx:36190:10: style: Condition 'b->metric' is always true [knownConditionTrueFalse] tetgen-1.6.0+dfsg1/tetgen.cxx:36178:9: note: Assuming that condition 'b->metric' is not redundant tetgen-1.6.0+dfsg1/tetgen.cxx:36190:10: note: Condition 'b->metric' is always true Explanation: Both main and the PR report the same warning: 'b->metric' at line 36190 is always true. It is nested inside `if ((b->metric) && (m.bgm != NULL))` at line 36178, so the inner check is redundant. Only the attached error path differs: the PR version shows the note pointing back to the outer condition at 36178. That note is reasonable, but the warning itself, its location and its correctness are unchanged. The difference does not matter to users. ---- 48 / 50 ---- Verdict: NEUTRAL (high confidence) Package: https://ftp.debian.org/debian/pool/main/t/tk-html3/tk-html3_3.0~fossil20110109.orig.tar.gz Result: main tkHTML-4ee7aaa953d6cb59/tools/lemon.c:3081:10: style: Condition 'cp==0' is always false [knownConditionTrueFalse] Explanation: This warning appears on both sides at the same location with the same text. The 'main' line has no notes and the 'your' line has the note chain (lemp->vardest assumed non-redundant, cp assigned, condition always false). That is most likely just how the diff pairs the lines. The warning itself is a true positive: inside `else if (lemp->vardest)`, `cp = lemp->vardest` cannot be 0. It is still reported, so nothing changed for users. ---- 49 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/u/uacme/uacme_1.8.1.orig.tar.gz Result: main uacme-1.8.1/base64.c:159:47: error: Signed integer overflow for expression ''0'-52'. [integerOverflow] Explanation: The expression '0' - 52 is 48 - 52 = -4, a small negative int. That is not a signed overflow. Main apparently mis-typed the character literal as char and treated the result as truncated or wrapped, so the integerOverflow warning was a false positive. The PR fixes integral promotion through getCommonIntegralType, which removes the bogus warning. ---- 50 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/x/xylib/xylib_1.6.orig.tar.bz2 Result: main xylib-1.6/xylib/spectra.cpp:101:19: style: Comparing expression of type 'char' against value 176. Condition is always false. [compareValueOutOfTypeRangeError] Explanation: The code compares `*p == (char) 0xB0`. Both operands are `char`, and the cast makes the constant -80 on signed-char platforms or 176 on unsigned-char platforms, so it always matches the same char value. The comparison is meaningful and can be true. Main reported that 'char' was compared against value 176 and the condition is always false, which is a false positive. The PR fixes cast-value handling and plain-char range logic, so the warning is gone. Removing a false positive is an improvement.