AI review of 2026-10-21_17-32-48-ed115855f419-results.txt PR: #8930 https://github.com/cppcheck-opensource/cppcheck/pull/8930 Tested: ed115855f419d6c25840ae5f653d153d35c346c9 Merge base: 7bcaa494fd2de5317e16a3e68bb6db7e017c7610 Reviewed: 2026-10-22 12:42:24 UTC Model: claude-opus-5-5 (effort high) Results: 4 reviewed of 4 in the report Verdicts: 2 improvement, 2 regression Tokens: 8241 input, 9678 cache read, 3226 cache write, 3115 output The verdicts are written by AI and can be wrong. ---- 1 / 4 ---- Verdict: REGRESSION (medium 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/filament/src/GPUBuffer.cpp:30:27: error: Found an exit path from function with non-void return type that has missing return statement [missingReturn] Explanation: `dataTypeToSize` switches on `element.type`, a `GPUBuffer::ElementType` enum with a fixed underlying type (`uint8_t`). The switch has a case for each of the 8 enumerators, and each case returns. Cppcheck normally does not report missingReturn when a switch covers every value of an enum. The new warning most likely appears because the PR changed how ValueType is computed for enums with an explicit underlying type, and the enum's typeScope is no longer seen at the switch. As a result, the complete-switch check no longer recognizes the enum. This is a new false positive. ---- 2 / 4 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/q/qtdeclarative-opensource-src/qtdeclarative-opensource-src_5.15.19+dfsg.orig.tar.xz Result: main qtdeclarative-everywhere-src-5.15.19/src/3rdparty/masm/yarr/YarrPattern.h:346:27: performance: Function parameter 'term' should be passed by const reference. [passedByValue] Explanation: `TermChain(PatternTerm term)` takes `PatternTerm` by value and only copies it into the member. In Yarr, `PatternTerm` is a sizeable struct with a uint8_t-based enum, bitfields, a union holding pointers and structs, and several unsigned counters. That is well above the size threshold, so passing it by const reference is a valid suggestion and the main warning was a true positive. The PR changes how enums with an explicit underlying type (such as `uint8_t`) get their value type. This likely broke Cppcheck's size estimate for `PatternTerm`, which silently dropped the warning. The code is unchanged, so this is a lost true positive. ---- 3 / 4 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/q/qtdeclarative-opensource-src/qtdeclarative-opensource-src_5.15.19+dfsg.orig.tar.xz Result: your qtdeclarative-everywhere-src-5.15.19/src/qmldebug/qqmlprofilerevent_p.h:324:53: style: Condition 'm_dataType&External' is always false [knownConditionTrueFalse] qtdeclarative-everywhere-src-5.15.19/src/qmldebug/qqmlprofilerevent_p.h:323:43: note: Assignment 'm_dataType=static_cast(sizeof(char)*8)', assigned value is 8 qtdeclarative-everywhere-src-5.15.19/src/qmldebug/qqmlprofilerevent_p.h:324:53: note: Condition 'm_dataType&External' is always false Explanation: In the else branch, `m_dataType` is set to `sizeof(Number) * 8`, which is always a multiple of 8 (8, 16, 32, 64). `External` is a low flag bit in Qt's `Type` enum (believed to be 1; not shown in the excerpt). So `m_dataType & External` on the next line is always false, and the ternary always picks `&m_data`. The condition is redundant, so this is a true positive. It now appears because the PR resolves the enum's typedef'd underlying type (`quint16`), which lets value flow track the assigned value. ---- 4 / 4 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/q/qtdeclarative-opensource-src/qtdeclarative-opensource-src_5.15.19+dfsg.orig.tar.xz Result: your qtdeclarative-everywhere-src-5.15.19/src/qmldebug/qqmlprofilerevent_p.h:324:53: style: Condition 'm_dataType&External' is always false [knownConditionTrueFalse] qtdeclarative-everywhere-src-5.15.19/src/qmldebug/qqmlprofilerevent_p.h:323:43: note: Assignment 'm_dataType=static_cast(sizeof(qint8)*8)', assigned value is 8 qtdeclarative-everywhere-src-5.15.19/src/qmldebug/qqmlprofilerevent_p.h:324:53: note: Condition 'm_dataType&External' is always false Explanation: In the else branch, `m_dataType` is assigned `sizeof(Number) * 8`, which is always a multiple of 8. In Qt's `QQmlProfilerEvent`, `External` is the low bit (1), so `m_dataType & External` is always false right after that assignment, whatever `Number` is. The ternary on line 324 is redundant, and the knownConditionTrueFalse warning is a true positive. The PR now resolves the enum's underlying type through the typedef (`quint16`), which likely lets value flow track the value, so this is a newly found correct warning.