AI review of 2026-11-30_21-35-42-e566e2872ee6-results.txt PR: #9094 https://github.com/cppcheck-opensource/cppcheck/pull/9094 Tested: e566e2872ee6952d09b3d67a66546eae2693871c Merge base: 9d2720ad2d08daf705f2b066d7dce2692e12f391 Reviewed: 2026-12-01 21:37:52 UTC Model: claude-opus-5-5 (effort high) Results: 9 reviewed of 9 in the report, the test is still running (800 analysed of 1000 requested packages) Verdicts: 9 regression Tokens: 20345 input, 13284 cache read, 6642 cache write, 3058 output The verdicts are written by AI and can be wrong. ---- 1 / 9 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/b/bart/bart_1.0.00.orig.tar.gz Result: your bart-1.0.00/src/misc/dicom.c:218:2: error: Using pointer that is a temporary. [danglingTemporaryLifetime] bart-1.0.00/src/misc/dicom.c:217:41: note: Address of variable taken here. bart-1.0.00/src/misc/dicom.c:217:42: note: Temporary created here. bart-1.0.00/src/misc/dicom.c:218:2: note: Using pointer that is a temporary. Explanation: `&(uint16_t){ rows }` is a C compound literal. In C, a compound literal has automatic storage that lasts until the end of the enclosing block, here the function body. Storing its address in `dicom_elements[...].data` and using it later in the same function is therefore valid. The PR now makes `isTemporary` return true for any non-reference cast, and the compound literal is evidently parsed as a cast, so Cppcheck wrongly treats it as a temporary. The new danglingTemporaryLifetime error is a false positive. ---- 2 / 9 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/b/bart/bart_1.0.00.orig.tar.gz Result: your bart-1.0.00/src/misc/dicom.c:230:2: error: Using pointer that is a temporary. [danglingTemporaryLifetime] bart-1.0.00/src/misc/dicom.c:218:41: note: Address of variable taken here. bart-1.0.00/src/misc/dicom.c:227:8: note: Assuming condition is true bart-1.0.00/src/misc/dicom.c:218:42: note: Temporary created here. bart-1.0.00/src/misc/dicom.c:230:2: note: Using pointer that is a temporary. Explanation: Line 218 stores `&(uint16_t){ cols }`, a C compound literal. At block scope a compound literal has automatic storage that lasts until the end of the enclosing block, so the pointer stays valid for the rest of the function. It is not a dangling temporary. The PR now treats every non-reference cast as temporary, and the compound literal is parsed as a cast, so it is wrongly flagged. The reported line 230 does not even use the pointer from line 218; it assigns a different element. This is a new false positive. ---- 3 / 9 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/b/bart/bart_1.0.00.orig.tar.gz Result: your bart-1.0.00/src/simu/phantom.c:502:25: error: Using object that is a temporary. [danglingTemporaryLifetime] bart-1.0.00/src/simu/phantom.c:498:11: note: Address of variable taken here. bart-1.0.00/src/simu/phantom.c:498:11: note: Passed to constructor of 'data'. bart-1.0.00/src/simu/phantom.c:498:12: note: Temporary created here. bart-1.0.00/src/simu/phantom.c:502:25: note: Using object that is a temporary. Explanation: This is C code. `&(struct krn2d_data){ ... }` is a compound literal. In C, a compound literal inside a function has automatic storage duration that lasts until the end of the enclosing block. Here that block is the whole body of calc_sens, so `data.data` is still valid when my_sample is called on line 502. The PR changed isTemporary() so that any cast without a reference type is treated as a temporary. Cppcheck represents a compound literal as a cast-like token, so it is now wrongly flagged as a temporary. The new danglingTemporaryLifetime error is therefore a false positive. ---- 4 / 9 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/l/log4cplus/log4cplus_2.1.2.orig.tar.xz Result: your log4cplus-2.1.2/catch/include/internal/catch_session.cpp:121:35: error: Using reference to dangling temporary. [danglingTempReference] log4cplus-2.1.2/catch/include/internal/catch_session.cpp:120:25: note: Assigned to reference. log4cplus-2.1.2/catch/include/internal/catch_session.cpp:121:35: note: Using reference to dangling temporary. Explanation: In Catch2, `getAllTestCasesSorted()` returns `std::vector const&`, a reference to registry-owned storage. `const_cast&>` of that reference yields a reference to the same long-lived object, not a temporary, so `tests` does not dangle. The PR dropped the separate `isCPPCast` handling in `isTemporary`, so `const_cast` expressions are now apparently classified as temporaries. The new danglingTempReference warning is a false positive. ---- 5 / 9 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/s/stenc/stenc_2.0.1.orig.tar.gz Result: your scsitape-stenc-704b5dd/tests/catch.hpp:13392:35: error: Using reference to dangling temporary. [danglingTempReference] scsitape-stenc-704b5dd/tests/catch.hpp:13391:25: note: Assigned to reference. scsitape-stenc-704b5dd/tests/catch.hpp:13392:35: note: Using reference to dangling temporary. Explanation: In Catch2, `getAllTestCasesSorted()` returns `std::vector const&`, which refers to persistent registry storage, not a temporary. `const_cast&>(...)` only strips const from that reference, so `tests` binds to a valid long-lived object and the range-for is safe. The PR changed `isTemporary` to handle only `tok->isCast()` and dropped the `isCPPCast` branch. The keyword `const_cast` is apparently no longer recognized as a cast here, so the call result is treated as a temporary. The new `danglingTempReference` warning is a false positive. ---- 6 / 9 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/v/virglrenderer/virglrenderer_1.3.0.orig.tar.bz2 Result: your virglrenderer-1.3.0/server/render_socket.c:133:7: error:inconclusive: Using object that is a temporary. [danglingTemporaryLifetime] virglrenderer-1.3.0/server/render_socket.c:123:10: note: Address of variable taken here. virglrenderer-1.3.0/server/render_socket.c:122:16: note: Passed to initializer list. virglrenderer-1.3.0/server/render_socket.c:131:8: note: Assuming condition is true virglrenderer-1.3.0/server/render_socket.c:123:11: note: Temporary created here. virglrenderer-1.3.0/server/render_socket.c:133:7: note: Using object that is a temporary. Explanation: The code takes the address of a C99 compound literal, `&(struct iovec){...}`, at block scope. In C a compound literal has automatic storage for the whole enclosing block, so it is still alive at line 133 and when `&msg` is later used. It is not a temporary. The PR changed isTemporary() so that any non-reference cast counts as a temporary, and Cppcheck treats a compound literal as a cast, so it now reports danglingTemporaryLifetime here. The new warning is a false positive. ---- 7 / 9 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/v/virglrenderer/virglrenderer_1.3.0.orig.tar.bz2 Result: your virglrenderer-1.3.0/server/render_socket.c:235:7: error:inconclusive: Using object that is a temporary. [danglingTemporaryLifetime] virglrenderer-1.3.0/server/render_socket.c:225:10: note: Address of variable taken here. virglrenderer-1.3.0/server/render_socket.c:224:16: note: Passed to initializer list. virglrenderer-1.3.0/server/render_socket.c:233:8: note: Assuming condition is true virglrenderer-1.3.0/server/render_socket.c:225:11: note: Temporary created here. virglrenderer-1.3.0/server/render_socket.c:235:7: note: Using object that is a temporary. Explanation: The code takes the address of a C compound literal `&(struct iovec){...}` inside a struct initializer. In C, a compound literal at block scope has automatic storage duration for the whole enclosing block, so it is still alive when `msg` is used at line 235 and later. There is no dangling temporary here. The PR's change to isTemporary makes casts return true by default, so the compound literal (parsed as a cast) is now treated as a temporary. That causes this new false positive. It is also reported on an unrelated use (`msg.msg_control = cmsg_buf`). ---- 8 / 9 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/v/virglrenderer/virglrenderer_1.3.0.orig.tar.bz2 Result: your virglrenderer-1.3.0/src/proxy/proxy_socket.c:150:7: error:inconclusive: Using object that is a temporary. [danglingTemporaryLifetime] virglrenderer-1.3.0/src/proxy/proxy_socket.c:140:10: note: Address of variable taken here. virglrenderer-1.3.0/src/proxy/proxy_socket.c:139:16: note: Passed to initializer list. virglrenderer-1.3.0/src/proxy/proxy_socket.c:148:8: note: Assuming condition is true virglrenderer-1.3.0/src/proxy/proxy_socket.c:140:11: note: Temporary created here. virglrenderer-1.3.0/src/proxy/proxy_socket.c:150:7: note: Using object that is a temporary. Explanation: This is C code. The compound literal `(struct iovec){...}` at function scope has automatic storage duration that lasts until the end of the enclosing block. Taking its address and storing it in `msg.msg_iov` is therefore valid for the whole function, so using `msg` at line 150 is fine. The PR changed `isTemporary` so that any non-reference cast counts as a temporary, and Cppcheck parses this compound literal as a cast. That is why it now reports a dangling temporary. The new warning is a false positive. ---- 9 / 9 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/v/virglrenderer/virglrenderer_1.3.0.orig.tar.bz2 Result: your virglrenderer-1.3.0/src/proxy/proxy_socket.c:231:7: error:inconclusive: Using object that is a temporary. [danglingTemporaryLifetime] virglrenderer-1.3.0/src/proxy/proxy_socket.c:221:10: note: Address of variable taken here. virglrenderer-1.3.0/src/proxy/proxy_socket.c:220:16: note: Passed to initializer list. virglrenderer-1.3.0/src/proxy/proxy_socket.c:229:8: note: Assuming condition is true virglrenderer-1.3.0/src/proxy/proxy_socket.c:221:11: note: Temporary created here. virglrenderer-1.3.0/src/proxy/proxy_socket.c:231:7: note: Using object that is a temporary. Explanation: This is C code. `&(struct iovec){...}` is a compound literal. In C, a compound literal inside a function body has automatic storage duration that lasts until the end of the enclosing block, so `msg.msg_iov` stays valid for the whole function and nothing dangles. The PR changed isTemporary() so that a cast to a non-reference type always counts as a temporary. Cppcheck apparently represents the compound literal `(struct iovec){...}` as a cast, so it is now treated as a temporary, which produces this new false positive. Also, line 231 only assigns `msg.msg_control` and does not use msg_iov at all.