AI review of 2026-10-14_15-39-00-22d1c8c8b9eb-results.txt PR: #8941 https://github.com/cppcheck-opensource/cppcheck/pull/8941 Tested: 22d1c8c8b9eb71d20766407d17db77021867fd2e Merge base: b2d83612a1d235901d70a77d25c21759014e4919 Reviewed: 2026-10-16 04:33:02 UTC Model: claude-opus-5-5 (effort high) Results: 4 reviewed of 4 in the report, the test is still running (900 analysed of 1000 requested packages) Verdicts: 4 improvement Tokens: 10094 input, 9642 cache read, 3214 cache write, 1753 output The verdicts are written by AI and can be wrong. ---- 1 / 4 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/x/xgks/xgks_2.6.1+dfsg.2.orig.tar.gz Result: main xgks-2.6.1+dfsg.2/src/port/misc/config.c:946:14: style: Condition '((int)c)<0' is always false [knownConditionTrueFalse] xgks-2.6.1+dfsg.2/src/port/misc/config.c:945:5: note: Assignment 'c=(char)(-1)', assigned value is 255 xgks-2.6.1+dfsg.2/src/port/misc/config.c:946:14: note: Condition '((int)c)<0' is always false Explanation: The code assigns `c = (char)(-1)` to a plain `char` and then tests `((int)c)<0` to detect whether `char` is signed at runtime. Main ignored the platform's default char signedness when truncating, so it treated plain char as unsigned. It computed 255 and claimed the condition is always false. That is wrong on the usual platforms where plain char is signed, since there the value is -1. The PR applies `platform.defaultSign` to plain char, so this incorrect value and the false 'always false' warning are gone. The replacement 'always true' line is now correct for the analyzed platform. ---- 2 / 4 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/x/xgks/xgks_2.6.1+dfsg.2.orig.tar.gz Result: main xgks-2.6.1+dfsg.2/src/port/misc/config.c:949:38: style: Condition 'is_signed' is always false [knownConditionTrueFalse] xgks-2.6.1+dfsg.2/src/port/misc/config.c:947:17: note: Assignment 'is_signed=0', assigned value is 0 xgks-2.6.1+dfsg.2/src/port/misc/config.c:946:14: note: Assuming condition is false xgks-2.6.1+dfsg.2/src/port/misc/config.c:948:2: note: Assuming condition is true xgks-2.6.1+dfsg.2/src/port/misc/config.c:949:38: note: Condition 'is_signed' is always false Explanation: The code sets `c = (char)(-1)` and checks `((int)c) < 0` to find out whether plain char is signed. On the analyzed platform plain char is signed by default (defaultSign 's'). Main truncated -1 into a plain char as if it were unsigned, giving 255. It therefore wrongly concluded that `is_signed` is always 0 and reported 'Condition is_signed is always false'. That conclusion is wrong for this platform, so the removed warning was a false positive. The PR uses the platform's default char signedness when truncating, so the value is now -1. The replacement 'always true' message matches actual behavior on the configured platform. ---- 3 / 4 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/x/xgks/xgks_2.6.1+dfsg.2.orig.tar.gz Result: your xgks-2.6.1+dfsg.2/src/port/misc/config.c:946:14: style: Condition '((int)c)<0' is always true [knownConditionTrueFalse] xgks-2.6.1+dfsg.2/src/port/misc/config.c:945:5: note: Assignment 'c=(char)(-1)', assigned value is -1 xgks-2.6.1+dfsg.2/src/port/misc/config.c:946:14: note: Condition '((int)c)<0' is always true Explanation: The code assigns `(char)(-1)` to `c` and then tests `((int)c)<0` to find out at runtime whether plain char is signed. Main treated plain char as unsigned and claimed the value is 255, so the condition is 'always false'. That is wrong on the analyzed platform, whose default char sign is signed. With the PR, plain char follows `platform.defaultSign`, so the value is -1 and the condition is reported 'always true', which matches the platform. The warning is still of limited use here, because this is a deliberate portability probe. But the message and its value-flow notes are now correct instead of wrong, so this counts as a more accurate message. ---- 4 / 4 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/x/xgks/xgks_2.6.1+dfsg.2.orig.tar.gz Result: your xgks-2.6.1+dfsg.2/src/port/misc/config.c:949:38: style: Condition 'is_signed' is always true [knownConditionTrueFalse] xgks-2.6.1+dfsg.2/src/port/misc/config.c:946:28: note: Assignment 'is_signed=1', assigned value is 1 xgks-2.6.1+dfsg.2/src/port/misc/config.c:946:14: note: Assuming condition is true xgks-2.6.1+dfsg.2/src/port/misc/config.c:948:2: note: Assuming condition is true xgks-2.6.1+dfsg.2/src/port/misc/config.c:949:38: note: Condition 'is_signed' is always true Explanation: The code assigns (char)(-1) to c and tests ((int)c)<0 to find out whether plain char is signed. Main truncated -1 into a char of unknown sign as unsigned, giving 255, so it reported is_signed as always false. That is wrong on the default platform, where char is signed. With the PR, plain char follows platform.defaultSign, so c is -1, is_signed=1, and the condition is 'always true'. That is correct for the analyzed platform. The warning is still of limited use, since this code exists to detect platform properties, but the reported value is now accurate where before it was wrong.