AI review of 2026-10-26_12-34-58-c594e9b063e0-results.txt PR: #8963 https://github.com/cppcheck-opensource/cppcheck/pull/8963 Tested: c594e9b063e0545d0ac200335d72f33d8d16dcb4 Merge base: 1516cd2c2dc4b5a44b63576637cd53bc423dcaf1 Reviewed: 2026-11-02 02:10:14 UTC Model: claude-opus-5-5 (effort high) Results: 2 reviewed of 2 in the report Verdicts: 2 regression Tokens: 3209 input, 0 cache read, 4918 cache write, 2819 output The verdicts are written by AI and can be wrong. ---- 1 / 2 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/i/iwd/iwd_3.12.orig.tar.xz Result: your iwd-3.12/ell/dbus.c:673:17: error: Buffer is accessed out of bounds: &hdr [bufferAccessOutOfBounds] Explanation: In ell, `struct dbus_header` is packed: four `uint8_t` fields followed by an anonymous union of two 12-byte packed structs (`dbus1`, `kdbus`). So its size is 16, which equals `DBUS_HEADER_SIZE`, and `recv(fd, &hdr, 16, ...)` is in bounds. The new code treats a member whose type is nested in an anonymous union as a union member and computes `std::max(total, n)`. Here `total` already includes the 4 preceding byte fields, so `dbus1` gives max(4, 12) = 12 instead of 4 + 12 = 16, and `kdbus` keeps it at 12. Cppcheck now thinks sizeof(hdr) is 12, which produces this false bufferAccessOutOfBounds. The PR's test only covers a union that is the first member, so it does not catch this. ---- 2 / 2 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/t/texlive-bin/texlive-bin_2026.20260303.78225+ds.orig.tar.xz Result: your texlive-bin-2026.20260303.78225/libs/xpdf/xpdf-src/fofi/FoFiType1C.cc:2107:34: performance: Function parameter 'op' should be passed by const reference. [passedByValue] Explanation: In xpdf, `Type1COp` is a `kind` enum plus an anonymous union of small members (`int intgr`, `double flt`, a small rational struct, `int op`). Its real size on 64-bit is about 16 bytes, which does not exceed cppcheck's large-object threshold of 2*sizeof(pointer). The PR drops the old special handling of anonymous-union members, which counted the union only once. The new `isUnion` test only fires when the member's own type scope is nested inside an anonymous union. Members like `int` and `double`, or a struct declared elsewhere, are therefore summed as if the union were a struct. That inflates `sizeof(Type1COp)` above the threshold and produces this new passedByValue warning. Passing a 16-byte trivially copyable struct by value is fine, so this is likely a new false positive caused by miscomputing the size of anonymous unions.