AI review of 2026-10-28_19-27-18-3c56ef2e9d4f-results.txt PR: #8976 https://github.com/cppcheck-opensource/cppcheck/pull/8976 Tested: 3c56ef2e9d4ffb92e15fafa0068a4cbc6e1a185d Merge base: ffe7e9be207e201c7b8d6ed5272b931889879a14 Reviewed: 2026-10-29 14:16:22 UTC Model: claude-opus-5-5 (effort high) Results: 50 reviewed of 929 in the report (random sample) Verdicts: 50 improvement Tokens: 175566 input, 64760 cache read, 16190 cache write, 9636 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/a/android-platform-external-libselinux/android-platform-external-libselinux_10.0.0+r36.orig.tar.gz Result: main libselinux/src/callbacks.c:26:29: style: Parameter 'ptr' can be declared as pointer to const. However it seems that 'default_selinux_audit' is a callback function, if 'ptr' is declared with const you might also need to cast function pointer(s). [constParameterCallback] libselinux/src/callbacks.c:64:2: note: You might need to cast the function pointer here libselinux/src/callbacks.c:26:29: note: Parameter 'ptr' can be declared as pointer to const Explanation: `default_selinux_audit` is a default callback assigned to the `selinux_audit` function pointer, which has a fixed signature. Its parameter `ptr` is explicitly marked `__attribute__((unused))`. The parameter is unused only because it is a stub, so suggesting const is noise; changing it would also force a function pointer cast. The PR now recognizes `__attribute__((unused))` on parameters and treats them like `[[maybe_unused]]`, which suppresses this warning. Removing it is the intended behavior and is covered by the new test. ---- 2 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/a/android-platform-external-libselinux/android-platform-external-libselinux_10.0.0+r36.orig.tar.gz Result: main libsemanage/src/database_policydb.c:291:51: style: Parameter 'handle' can be declared as pointer to const. However it seems that 'dbase_policydb_del' is a callback function, if 'handle' is declared with const you might also need to cast function pointer(s). [constParameterCallback] libsemanage/src/database_policydb.c:468:9: note: You might need to cast the function pointer here libsemanage/src/database_policydb.c:291:51: note: Parameter 'handle' can be declared as pointer to const Explanation: dbase_policydb_del is a stub callback whose 'handle' parameter is explicitly marked __attribute__((unused)), and it is assigned to a function pointer table. Suggesting const for a parameter the author deliberately marks unused in a callback with a fixed signature is noise. The PR now recognizes the trailing parameter attribute and suppresses the warning, so a false positive is removed. ---- 3 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/a/android-platform-external-libselinux/android-platform-external-libselinux_10.0.0+r36.orig.tar.gz Result: main libsepol/cil/src/cil_build_ast.c:90:81: style: Parameter 'old' can be declared as pointer to const [constParameterPointer] Explanation: The parameter 'old' is explicitly marked __attribute__((unused)) and is never used in cil_is_datum_multiple_decl. Telling the user to const-qualify a parameter they have deliberately marked unused is noise. The function signature is most likely fixed by an API or interface. The PR now treats __attribute__((unused)) like [[maybe_unused]] for parameters, so removing this constParameterPointer warning removes a false positive. ---- 4 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/c/cairo-dock/cairo-dock_3.5.1.orig.tar.gz Result: main Cairo-Dock-cairo-dock-core-35c8f73/src/cairo-dock-user-interaction.c:510:109: style: Parameter 'pDock' can be declared as pointer to const [constParameterPointer] Explanation: The parameter 'pDock' is declared with G_GNUC_UNUSED, which expands to __attribute__((unused)). The function is a notification callback whose signature is fixed, and the parameter is deliberately unused. Suggesting that it be made pointer to const is noise. The PR now treats __attribute__((unused)) on parameters like [[maybe_unused]], so the constParameterPointer false positive is gone. ---- 5 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/c/cairo-dock/cairo-dock_3.5.1.orig.tar.gz Result: main Cairo-Dock-cairo-dock-core-35c8f73/src/cairo-dock-user-menu.c:362:66: style: Parameter 'pMenuItem' can be declared as pointer to const. However it seems that '_cairo_dock_present_help' is a callback function, if 'pMenuItem' is declared with const you might also need to cast function pointer(s). [constParameterCallback] Cairo-Dock-cairo-dock-core-35c8f73/src/cairo-dock-user-menu.c:1098:4: note: You might need to cast the function pointer here Cairo-Dock-cairo-dock-core-35c8f73/src/cairo-dock-user-menu.c:362:66: note: Parameter 'pMenuItem' can be declared as pointer to const Explanation: `pMenuItem` is declared with G_GNUC_UNUSED, which expands to `__attribute__((__unused__))`. The parameter is explicitly marked unused and the function is a GTK menu callback with a fixed signature. Suggesting const for it is noise. The PR now treats the unused attribute on parameters as maybe_unused, so this false positive is suppressed. ---- 6 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/c/cairo-dock/cairo-dock_3.5.1.orig.tar.gz Result: main Cairo-Dock-cairo-dock-core-35c8f73/src/cairo-dock-user-menu.c:395:151: style: Parameter 'pDialog' can be declared as pointer to const. However it seems that '_on_answer_quit' is a callback function, if 'pDialog' is declared with const you might also need to cast function pointer(s). [constParameterCallback] Cairo-Dock-cairo-dock-core-35c8f73/src/cairo-dock-user-menu.c:413:33: note: You might need to cast the function pointer here Cairo-Dock-cairo-dock-core-35c8f73/src/cairo-dock-user-menu.c:395:151: note: Parameter 'pDialog' can be declared as pointer to const Explanation: The parameter 'pDialog' is declared with G_GNUC_UNUSED, which expands to __attribute__((unused)). The PR now treats parameters marked unused like maybe_unused and stops suggesting const for them. Making an unused callback parameter const adds nothing, and here it would also force a function-pointer cast. Removing this warning removes noise and is an intended effect of the PR. ---- 7 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/d/dateutils/dateutils_0.4.12.orig.tar.gz Result: main dateutils-0.4.12/lib/testlib.c:61:46: style: Parameter 'argv' can be declared as const array [constParameter] Explanation: argv is explicitly marked __attribute__((unused)) and is never used in main. Suggesting that it be declared const is noise, and changing main's signature that way is not idiomatic anyway. The PR now recognizes unused attributes on parameters and treats them like maybe_unused, which removes this false positive / unhelpful style warning. ---- 8 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/d/dateutils/dateutils_0.4.12.orig.tar.gz Result: main dateutils-0.4.12/src/dt-io.h:188:56: style: Parameter 'fp' can be declared as pointer to const [constParameterPointer] Explanation: Column 56 points to the `fp` parameter in the non-glibc branch (`__io_setlocking_bycaller(__attribute__((unused)) FILE *fp)`), which is marked unused. In the glibc branch the same parameter is passed to `__fsetlocking`, which needs a non-const `FILE*`. So suggesting pointer-to-const for a deliberately unused, config-dependent parameter is a false positive. The PR now honours `__attribute__((unused))` on parameters, which removes it. ---- 9 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/f/fapolicyd/fapolicyd_2.0.orig.tar.gz Result: main fapolicyd-2.0/src/library/trust-file.c:642:15: style: Parameter 'ftwbuf' can be declared as pointer to const. However it seems that 'ftw_delete_path' is a callback function, if 'ftwbuf' is declared with const you might also need to cast function pointer(s). [constParameterCallback] fapolicyd-2.0/src/library/trust-file.c:722:24: note: You might need to cast the function pointer here fapolicyd-2.0/src/library/trust-file.c:642:15: note: Parameter 'ftwbuf' can be declared as pointer to const Explanation: The parameter 'ftwbuf' is explicitly marked __attribute__((unused)) in an nftw callback, whose signature is fixed by nftw. Suggesting that it be made pointer to const is noise, because the developer has already said it is intentionally unused. The PR now recognizes the unused attribute on parameters and treats them as maybe-unused, so this false positive is gone. ---- 10 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/f/fapolicyd/fapolicyd_2.0.orig.tar.gz Result: main fapolicyd-2.0/src/library/trust-file.c:659:15: style: Parameter 'ftwbuf' can be declared as pointer to const. However it seems that 'ftw_update_path' is a callback function, if 'ftwbuf' is declared with const you might also need to cast function pointer(s). [constParameterCallback] fapolicyd-2.0/src/library/trust-file.c:739:24: note: You might need to cast the function pointer here fapolicyd-2.0/src/library/trust-file.c:659:15: note: Parameter 'ftwbuf' can be declared as pointer to const Explanation: The parameter 'ftwbuf' in callback ftw_update_path is explicitly marked __attribute__((unused)). It is never used, and it must keep the nftw callback signature. Telling the user to make it const (and maybe cast function pointers) is noise. The PR now treats the unused attribute on parameters like maybe_unused, so this warning is suppressed, which is the intended behavior. ---- 11 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/f/fsvs/fsvs_1.2.12.orig.tar.gz Result: main fsvs-fsvs-1.2.12/src/ignore.c:1637:14: style: Unused variable: namelen [unusedVariable] Explanation: Line 1637 declares `namelen UNUSED` inside a comma-separated declaration list. In fsvs, `UNUSED` is the GCC `__attribute__((unused))` macro. Before the PR, Cppcheck only applied the attribute when it was followed by `;`, `=` or `{`, so the `,` after `namelen UNUSED` was missed and Cppcheck reported the variable as unused. The PR also accepts `,` and `)`, so the attribute is now recognized. The developer explicitly marked the variable as intentionally unused, and compilers do not warn about it either, so removing this warning removes a false positive. ---- 12 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/g/gnome-panel/gnome-panel_3.58.1.orig.tar.xz Result: main gnome-panel-3.58.1/modules/status-notifier/sn-host-v0-gen.c:333:17: style: Parameter 'pspec' can be declared as pointer to const. However it seems that 'sn_host_v0_gen_proxy_set_property' is a callback function, if 'pspec' is declared with const you might also need to cast function pointer(s). [constParameterCallback] gnome-panel-3.58.1/modules/status-notifier/sn-host-v0-gen.c:428:33: note: You might need to cast the function pointer here gnome-panel-3.58.1/modules/status-notifier/sn-host-v0-gen.c:333:17: note: Parameter 'pspec' can be declared as pointer to const Explanation: The parameter 'pspec' is marked G_GNUC_UNUSED, which expands to __attribute__((unused)). It is a GObject set_property callback whose signature is fixed by GLib, and the parameter is intentionally unused. Suggesting const here is noise. With the PR, Cppcheck now sees the unused attribute on parameters and treats the parameter as maybe-unused, so the warning goes away. This matches the PR's intent and its test case. ---- 13 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/g/gst-plugins-good1.0/gst-plugins-good1.0_1.29.2.orig.tar.xz Result: main gst-plugins-good-1.29.2/tests/check/elements/rtpbin.c:928:45: style: Parameter 'rtpbin' can be declared as pointer to const. However it seems that '_request_pt_map' is a callback function, if 'rtpbin' is declared with const you might also need to cast function pointer(s). [constParameterCallback] gst-plugins-good-1.29.2/tests/check/elements/rtpbin.c:953:5: note: You might need to cast the function pointer here gst-plugins-good-1.29.2/tests/check/elements/rtpbin.c:928:45: note: Parameter 'rtpbin' can be declared as pointer to const Explanation: The parameter 'rtpbin' is marked G_GNUC_UNUSED, which expands to __attribute__((unused)). The developer has explicitly said the parameter is unused, and it is a signal callback whose signature is fixed by GObject. Suggesting a const pointer there is noise. With the PR, the attribute is now recognized on parameters followed by ',' or ')', and treated like maybe_unused, so the constParameterCallback warning is suppressed. Removing this false positive is good for users. ---- 14 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/g/gst-plugins-good1.0/gst-plugins-good1.0_1.29.2.orig.tar.xz Result: main gst-plugins-good-1.29.2/tests/check/elements/rtpjitterbuffer.c:421:44: style: Parameter 'jitterbuffer' can be declared as pointer to const. However it seems that 'request_pt_map' is a callback function, if 'jitterbuffer' is declared with const you might also need to cast function pointer(s). [constParameterCallback] gst-plugins-good-1.29.2/tests/check/elements/rtpjitterbuffer.c:440:3: note: You might need to cast the function pointer here gst-plugins-good-1.29.2/tests/check/elements/rtpjitterbuffer.c:421:44: note: Parameter 'jitterbuffer' can be declared as pointer to const Explanation: The parameter is marked G_GNUC_UNUSED, which expands to __attribute__((unused)). It is a signal callback whose signature is fixed by GObject, and the parameter is deliberately unused. Suggesting const here is noise, since the author has explicitly marked it unused. The PR now treats __attribute__((unused)) on parameters like [[maybe_unused]], so this false positive is removed. ---- 15 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/k/krb5-auth-dialog/krb5-auth-dialog_44.0~alpha1.orig.tar.xz Result: main krb5-auth-dialog-44.0.alpha1/src/ka-plugin.c:115:27: style: Parameter 'self' can be declared as pointer to const [constParameterPointer] Explanation: G_GNUC_UNUSED expands to __attribute__((__unused__)). ka_plugin_init is a GObject instance init callback whose signature is fixed by G_DEFINE_TYPE, and the parameter is explicitly marked unused. Telling the user to make it pointer to const is noise they cannot act on. The PR now recognizes the unused attribute on parameters and suppresses the warning, so a false positive is removed. ---- 16 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/k/kylin-ai-vector-engine/kylin-ai-vector-engine_1.2.0.1.orig.tar.gz Result: main kylin-ai-vector-engine-1.2.0.1/thirdparty/arrow/cpp/src/arrow/vendored/uriparser/UriMemory.c:82:51: style: Parameter 'unused_memory' can be declared as pointer to const. However it seems that 'uriDefaultCalloc' is a callback function, if 'unused_memory' is declared with const you might also need to cast function pointer(s). [constParameterCallback] kylin-ai-vector-engine-1.2.0.1/thirdparty/arrow/cpp/src/arrow/vendored/uriparser/UriMemory.c:463:2: note: You might need to cast the function pointer here kylin-ai-vector-engine-1.2.0.1/thirdparty/arrow/cpp/src/arrow/vendored/uriparser/UriMemory.c:82:51: note: Parameter 'unused_memory' can be declared as pointer to const Explanation: URI_UNUSED(memory) expands to 'unused_memory __attribute__((unused))'. The parameter is deliberately unused, and the function is a callback whose signature must match the UriMemoryManager function pointer type. Telling the user to make it pointer to const is noise. The PR now treats __attribute__((unused)) on parameters as maybe-unused, so the warning is suppressed. This is the intended behavior. ---- 17 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/l/ledmon/ledmon_0.97.orig.tar.gz Result: main ledmon-0.97/src/block.c:107:46: style: Parameter 'device' can be declared as pointer to const. However it seems that 'do_not_flush' is a callback function, if 'device' is declared with const you might also need to cast function pointer(s). [constParameterCallback] ledmon-0.97/src/block.c:122:12: note: You might need to cast the function pointer here ledmon-0.97/src/block.c:107:46: note: Parameter 'device' can be declared as pointer to const Explanation: `do_not_flush` marks `device` with `__attribute__((unused))`. It is a callback that must match the `flush_message_t` signature, and the parameter is intentionally unused. Suggesting it be made pointer to const is noise; the cast suggestion for the callback is not useful either. The PR now treats parameters with the GCC unused attribute as maybe-unused, which removes this false positive, exactly as intended. ---- 18 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/libj/libjna-java/libjna-java_5.19.1.orig.tar.xz Result: main jna-5.19.1/native/dispatch.c:2816:10: style: Parameter 'UNUSED_env' can be declared as pointer to const [constParameterPointer] Explanation: `UNUSED(env)` expands to a parameter named `UNUSED_env` marked `__attribute__((unused))`. This is a JNI entry point whose signature is fixed by JNI, and the parameter is deliberately never used. Suggesting it be made pointer to const is noise. The PR now treats `__attribute__((unused))` parameters as maybe-unused, so the warning goes away, which is the intended behavior and matches the new test. ---- 19 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/libj/libjna-java/libjna-java_5.19.1.orig.tar.xz Result: main jna-5.19.1/native/testlib.c:1058:62: style: Parameter 'UNUSED_env' can be declared as pointer to const [constParameterPointer] Explanation: The function takes `JNIEnv *UNUSED(env)`, which jna's dispatch.h expands to `UNUSED_env __attribute__((unused))`. The parameter is deliberately unused, and the JNI ABI requires its type to be `JNIEnv *`, so suggesting a pointer-to-const is noise. The PR now treats `__attribute__((unused))` on parameters as maybe-unused, which suppresses this false-positive style warning. ---- 20 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/libj/libjna-java/libjna-java_5.19.1.orig.tar.xz Result: main jna-5.19.1/native/testlib.c:1063:65: style: Parameter 'UNUSED_env' can be declared as pointer to const [constParameterPointer] Explanation: In this file, UNUSED(env) expands to UNUSED_env __attribute__((unused)). The parameter is a JNI callback argument that is intentionally unused, and the function signature is fixed by JNI. Suggesting to make it a pointer to const is noise for a parameter explicitly marked unused. The PR now treats __attribute__((unused)) on parameters as maybe-unused, so this warning is suppressed. That is the intended behavior. ---- 21 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/m/mariadb-connector-odbc/mariadb-connector-odbc_3.2.9.orig.tar.gz Result: main mariadb-connector-odbc-3.2.9/driver/ma_conv_charset.cpp:91:58: style: Parameter 'from_cs' can be declared as pointer to const [constParameterPointer] Explanation: `from_cs` is explicitly marked `__attribute__((unused))`. In the configuration without HAVE_ICONV the function body never touches it. It is a fixed public API signature (STDCALL, matching a header declaration). Suggesting const for a parameter the author marked as intentionally unused is noise. The PR deliberately treats `__attribute__((unused))` like `[[maybe_unused]]`, which already suppresses this warning. So removing the warning matches the intended behavior. In the iconv branch the pointer is only read, so const would technically be possible, but the suppression is still reasonable. ---- 22 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/m/mariadb/mariadb_11.8.9+ds.orig.tar.xz Result: main mariadb-11.8.9/mysys/psi_noop.c:350:49: style: Parameter 'locker' can be declared as pointer to const. However it seems that 'end_idle_wait_noop' is a callback function, if 'locker' is declared with const you might also need to cast function pointer(s). [constParameterCallback] mariadb-11.8.9/mysys/psi_noop.c:966:3: note: You might need to cast the function pointer here mariadb-11.8.9/mysys/psi_noop.c:350:49: note: Parameter 'locker' can be declared as pointer to const Explanation: In psi_noop.c, NNN is a macro that expands to __attribute__((unused)). It marks the 'locker' parameter of end_idle_wait_noop as deliberately unused. The function is an empty no-op callback stored in a function pointer table, so its signature has to match the interface. Suggesting const there is noise, and acting on it would also need a function-pointer cast. The PR now treats a trailing __attribute__((unused)) on a parameter as maybe_unused, which suppresses this warning. Removing it removes a false positive. ---- 23 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/m/mariadb/mariadb_11.8.9+ds.orig.tar.xz Result: main mariadb-11.8.9/mysys/psi_noop.c:379:55: style: Parameter 'locker' can be declared as pointer to const. However it seems that 'end_rwlock_rdwait_noop' is a callback function, if 'locker' is declared with const you might also need to cast function pointer(s). [constParameterCallback] mariadb-11.8.9/mysys/psi_noop.c:970:3: note: You might need to cast the function pointer here mariadb-11.8.9/mysys/psi_noop.c:379:55: note: Parameter 'locker' can be declared as pointer to const Explanation: In psi_noop.c, NNN is a macro that expands to __attribute__((unused)), placed after the parameter name. end_rwlock_rdwait_noop is a no-op stub used as a callback in a function table, and 'locker' is deliberately unused. The PR now records the GNU unused attribute on parameters and treats it like maybe_unused. Suggesting const for a parameter explicitly marked unused, in a callback where adding const would also force a function pointer cast, is noise. Removing this warning is an improvement. ---- 24 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/m/mariadb/mariadb_11.8.9+ds.orig.tar.xz Result: main mariadb-11.8.9/storage/maria/ma_loghandler.c:8902:38: style: Parameter 'trn' can be declared as pointer to const [constParameterPointer] Explanation: The parameter 'trn' is declared with __attribute__((unused)) because it is only used under #ifdef EXTRA_DEBUG. In that configuration it is passed to translog_write_record, so it cannot simply be made const. Suggesting 'pointer to const' for a parameter explicitly marked unused is noise. The PR now recognizes the unused attribute on parameters and suppresses the warning, so removing this false positive is an improvement. ---- 25 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/m/mate-settings-daemon/mate-settings-daemon_1.26.1.orig.tar.xz Result: main mate-settings-daemon-1.26.1/plugins/a11y-keyboard/msd-a11y-preferences-dialog.c:130:40: style: Parameter 'dialog' can be declared as pointer to const. However it seems that 'on_response' is a callback function, if 'dialog' is declared with const you might also need to cast function pointer(s). [constParameterCallback] mate-settings-daemon-1.26.1/plugins/a11y-keyboard/msd-a11y-preferences-dialog.c:839:9: note: You might need to cast the function pointer here mate-settings-daemon-1.26.1/plugins/a11y-keyboard/msd-a11y-preferences-dialog.c:130:40: note: Parameter 'dialog' can be declared as pointer to const Explanation: The parameter 'dialog' is marked G_GNUC_UNUSED, which expands to __attribute__((__unused__)). The function is a GTK signal callback, so its signature is fixed and the parameter is deliberately unused. Suggesting const here is noise, and it would also require casting the function pointer. The PR now treats the unused attribute on parameters like maybe_unused, so this false positive is suppressed. ---- 26 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/m/mate-settings-daemon/mate-settings-daemon_1.26.1.orig.tar.xz Result: main mate-settings-daemon-1.26.1/plugins/housekeeping/msd-disk-space.c:639:36: style: Parameter 'gsettings' can be declared as pointer to const. However it seems that 'msd_ldsm_update_config' is a callback function, if 'gsettings' is declared with const you might also need to cast function pointer(s). [constParameterCallback] mate-settings-daemon-1.26.1/plugins/housekeeping/msd-disk-space.c:660:9: note: You might need to cast the function pointer here mate-settings-daemon-1.26.1/plugins/housekeeping/msd-disk-space.c:639:36: note: Parameter 'gsettings' can be declared as pointer to const Explanation: The callback parameter 'gsettings' is marked G_GNUC_UNUSED, which expands to __attribute__((unused)). The parameter exists only to match the GSignal callback signature and is never used. Telling the user to make it const, and then cast the function pointer, is noise. The PR now treats unused-attributed parameters as maybe-unused, so this false positive goes away. ---- 27 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/m/mozjs128/mozjs128_128.14.0.orig.tar.xz Result: main firefox-128.14.0/js/src/ctypes/libffi/testsuite/libffi.closures/cls_dbls_struct.c:23:48: style: Parameter 'resp' can be declared as pointer to const. However it seems that 'closure_test_gn' is a callback function, if 'resp' is declared with const you might also need to cast function pointer(s). [constParameterCallback] firefox-128.14.0/js/src/ctypes/libffi/testsuite/libffi.closures/cls_dbls_struct.c:57:2: note: You might need to cast the function pointer here firefox-128.14.0/js/src/ctypes/libffi/testsuite/libffi.closures/cls_dbls_struct.c:23:48: note: Parameter 'resp' can be declared as pointer to const Explanation: In `closure_test_gn`, the parameter `resp` is marked `__UNUSED__`, which in ffitest.h expands to `__attribute__((unused))`. It is also a libffi closure callback, so its signature is fixed by the API (`void *resp`). Suggesting it be made pointer to const is noise: the user would have to cast the function pointer for no benefit. The PR now treats parameters with `__attribute__((unused))` as maybe-unused, so the constParameterCallback warning is suppressed. Removing this false positive is an improvement. ---- 28 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/m/mozjs128/mozjs128_128.14.0.orig.tar.xz Result: main firefox-128.14.0/js/src/ctypes/libffi/testsuite/libffi.closures/err_bad_abi.c:12:19: style: Parameter 'cif' can be declared as pointer to const. However it seems that 'dummy_fn' is a callback function, if 'cif' is declared with const you might also need to cast function pointer(s). [constParameterCallback] firefox-128.14.0/js/src/ctypes/libffi/testsuite/libffi.closures/err_bad_abi.c:33:2: note: You might need to cast the function pointer here firefox-128.14.0/js/src/ctypes/libffi/testsuite/libffi.closures/err_bad_abi.c:12:19: note: Parameter 'cif' can be declared as pointer to const Explanation: `dummy_fn` is a callback passed to `ffi_prep_closure_loc`, so its signature must match the closure type. Its parameter `cif` is marked `__UNUSED__`, which in ffitest.h expands to `__attribute__((unused))`. The warning to make the parameter const is pointless noise for a deliberately unused callback parameter. The PR now recognizes the unused attribute after a parameter name and treats it like maybe_unused, so removing this false positive is an improvement. ---- 29 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/m/mozjs128/mozjs128_128.14.0.orig.tar.xz Result: main firefox-128.14.0/js/src/ctypes/libffi/testsuite/libffi.closures/testclosure.c:27:28: style: Parameter 'userdata' can be declared as pointer to const. However it seems that 'cls_struct_combined_gn' is a callback function, if 'userdata' is declared with const you might also need to cast function pointer(s). [constParameterCallback] firefox-128.14.0/js/src/ctypes/libffi/testsuite/libffi.closures/testclosure.c:65:3: note: You might need to cast the function pointer here firefox-128.14.0/js/src/ctypes/libffi/testsuite/libffi.closures/testclosure.c:27:28: note: Parameter 'userdata' can be declared as pointer to const Explanation: The parameter 'userdata' is marked __UNUSED__, which ffitest.h defines as __attribute__((unused)). The function is a libffi closure callback, so its signature is fixed. Suggesting const for a parameter the author explicitly marked unused is noise. The PR now recognizes the unused attribute on parameters and treats them like [[maybe_unused]], which removes this false positive. ---- 30 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/n/netsniff-ng/netsniff-ng_0.6.9.orig.tar.xz Result: main netsniff-ng-0.6.9/proto_ipv6_hop_by_hop.c:23:46: style: Parameter 'pkt' can be declared as pointer to const [constParameterPointer] Explanation: The parameter 'pkt' is marked __maybe_unused, which expands to __attribute__((unused)). It is a placeholder that should later be used to pull packet data. With the PR, Cppcheck treats the unused attribute on parameters like [[maybe_unused]] and suppresses the constParameterPointer suggestion. The test added in the PR shows this is intended. Telling users to const-qualify a deliberately unused placeholder parameter is noise, so removing the warning is an improvement. ---- 31 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/n/netsniff-ng/netsniff-ng_0.6.9.orig.tar.xz Result: main netsniff-ng-0.6.9/proto_ipv6_no_nxt_hdr.c:17:45: style: Parameter 'pkt' can be declared as pointer to const. However it seems that 'no_next_header' is a callback function, if 'pkt' is declared with const you might also need to cast function pointer(s). [constParameterCallback] netsniff-ng-0.6.9/proto_ipv6_no_nxt_hdr.c:38:16: note: You might need to cast the function pointer here netsniff-ng-0.6.9/proto_ipv6_no_nxt_hdr.c:17:45: note: Parameter 'pkt' can be declared as pointer to const Explanation: The parameter 'pkt' is marked __maybe_unused, which netsniff-ng defines as __attribute__((unused)). The function is a callback assigned to struct protocol's print_full field, so its signature is fixed. The parameter is deliberately unused. Telling the user to make an intentionally unused parameter const is noise, and doing so would need a function pointer cast. The PR now recognizes the unused attribute on parameters, which removes this false positive. ---- 32 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/n/netsniff-ng/netsniff-ng_0.6.9.orig.tar.xz Result: main netsniff-ng-0.6.9/proto_none.c:15:29: style: Parameter 'pkt' can be declared as pointer to const [constParameterPointer] Explanation: `empty()` is a stub whose parameter is marked `__maybe_unused`, which in netsniff-ng expands to `__attribute__((unused))`. It is very likely used as a callback or to fit a fixed function signature, so suggesting a const pointer is noise. The PR now treats `__attribute__((unused))` on parameters as maybe-unused and suppresses the constParameterPointer warning, which is the intended behavior. ---- 33 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/n/netsniff-ng/netsniff-ng_0.6.9.orig.tar.xz Result: main netsniff-ng-0.6.9/ring.h:61:68: style: Parameter 'hdr' can be declared as pointer to const [constParameterPointer] Explanation: The parameter 'hdr' is marked __maybe_unused, which expands to __attribute__((unused)). It is only used inside a conditional block (HAVE_TPACKET3 && TP_STATUS_VLAN_TPID_VALID). The pointer cannot really be made const: the union's members are non-const pointers, and the signature has to fit other configurations and API uses. Making it const would also gain nothing, because the parameter is explicitly marked as possibly unused. The PR now treats the unused attribute on parameters like maybe_unused and suppresses the warning. This removes a noisy, configuration-dependent false positive. ---- 34 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/n/network-manager-applet/network-manager-applet_1.36.0.orig.tar.xz Result: main network-manager-applet-1.36.0/src/applet.c:1727:26: style: Parameter 'user_data' can be declared as pointer to const. However it seems that 'ce_child_setup' is a callback function, if 'user_data' is declared with const you might also need to cast function pointer(s). [constParameterCallback] network-manager-applet-1.36.0/src/applet.c:1744:48: note: You might need to cast the function pointer here network-manager-applet-1.36.0/src/applet.c:1727:26: note: Parameter 'user_data' can be declared as pointer to const Explanation: The parameter 'user_data' is marked G_GNUC_UNUSED, which expands to __attribute__((__unused__)). It is a GSpawnChildSetupFunc callback, so its signature is fixed. Because the parameter is intentionally unused, suggesting it be made pointer to const is noise. The PR makes cppcheck honour the unused attribute on parameters, so this false positive is now suppressed. ---- 35 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/r/rr/rr_5.10.0.orig.tar.gz Result: main rr-5.10.0/src/audit/stap-note-iter.c:57:48: style: Parameter 'self' can be declared as pointer to const [constParameterPointer] Explanation: The parameter 'self' is explicitly marked __attribute__((unused)). The function never uses it and keeps it only for API symmetry with stap_note_iter_map. Suggesting that it be made pointer to const is noise the developer has explicitly opted out of. With the PR, Cppcheck recognises the attribute after a parameter name and treats the parameter as maybe-unused, so this false positive is no longer reported. ---- 36 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/r/rr/rr_5.10.0.orig.tar.gz Result: main rr-5.10.0/src/chaos-test/starvation_multithreaded.c:44:55: style: Parameter 'p' can be declared as pointer to const. However it seems that 'aux_thread' is a callback function, if 'p' is declared with const you might also need to cast function pointer(s). [constParameterCallback] rr-5.10.0/src/chaos-test/starvation_multithreaded.c:69:30: note: You might need to cast the function pointer here rr-5.10.0/src/chaos-test/starvation_multithreaded.c:44:55: note: Parameter 'p' can be declared as pointer to const Explanation: `aux_thread` is a pthread callback. Its parameter `p` is explicitly marked `__attribute__((unused))`. Telling the user to make an intentionally unused parameter const, and then cast the function pointer, is noise. The PR now treats `__attribute__((unused))` on parameters like `[[maybe_unused]]`, which suppresses this false positive. ---- 37 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/r/rr/rr_5.10.0.orig.tar.gz Result: main rr-5.10.0/src/perf-test/many-threads.c:8:54: style: Parameter 'p' can be declared as pointer to const. However it seems that 'do_thread' is a callback function, if 'p' is declared with const you might also need to cast function pointer(s). [constParameterCallback] rr-5.10.0/src/perf-test/many-threads.c:27:31: note: You might need to cast the function pointer here rr-5.10.0/src/perf-test/many-threads.c:8:54: note: Parameter 'p' can be declared as pointer to const Explanation: `do_thread` is a pthread start routine whose parameter `p` is marked `__attribute__((unused))`. The function signature has to be `void*(void*)` to match `pthread_create`, so suggesting `const` would just force a function-pointer cast. The suggestion is pointless noise for a parameter that is explicitly marked unused. The PR now treats `__attribute__((unused))` on parameters like `maybe_unused`, which suppresses this warning as intended. ---- 38 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/r/rr/rr_5.10.0.orig.tar.gz Result: main rr-5.10.0/src/test-monitor/test-monitor.cc:45:54: style: Parameter 'ctx' can be declared as pointer to const. However it seems that 'sighandler' is a callback function, if 'ctx' is declared with const you might also need to cast function pointer(s). [constParameterCallback] rr-5.10.0/src/test-monitor/test-monitor.cc:391:21: note: You might need to cast the function pointer here rr-5.10.0/src/test-monitor/test-monitor.cc:45:54: note: Parameter 'ctx' can be declared as pointer to const Explanation: The parameter 'ctx' is marked __attribute__((unused)) and the function is a sigaction signal handler, so its signature is fixed. Suggesting const for a parameter that is explicitly declared unused is noise. The PR now treats __attribute__((unused)) on parameters like maybe_unused, which removes this false positive. ---- 39 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/s/simavr/simavr_1.6+dfsg.orig.tar.xz Result: main simavr-1.6/simavr/sim/sim_regbit.h:97:10: style: Parameter 'avr' can be declared as pointer to const [constParameterPointer] Explanation: The parameter 'avr' is explicitly marked __attribute__((unused)) and is never used. It is kept only to match the API of the sibling regbit functions. Suggesting it be made pointer to const is noise the user deliberately opted out of. The PR now applies the attribute to parameters and treats it like maybe_unused, which suppresses this warning, as the new test intends. This removes a false positive. ---- 40 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/t/transmission-remote-gtk/transmission-remote-gtk_1.7.1.orig.tar.xz Result: main transmission-remote-gtk-1.7.1/src/trg-main-window.c:285:54: style: Parameter 'event' can be declared as pointer to const. However it seems that 'delete_event' is a callback function, if 'event' is declared with const you might also need to cast function pointer(s). [constParameterCallback] transmission-remote-gtk-1.7.1/src/trg-main-window.c:1923:5: note: You might need to cast the function pointer here transmission-remote-gtk-1.7.1/src/trg-main-window.c:285:54: note: Parameter 'event' can be declared as pointer to const Explanation: `event` is marked G_GNUC_UNUSED, which expands to __attribute__((__unused__)). The parameter is deliberately unused in a GTK delete-event callback with a fixed signature. Suggesting it be made pointer to const (and that the function pointer be cast) is noise. Treating unused-attributed parameters as maybe_unused now suppresses this, so a false positive is removed. ---- 41 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/t/transmission-remote-gtk/transmission-remote-gtk_1.7.1.orig.tar.xz Result: main transmission-remote-gtk-1.7.1/src/trg-peers-tree-view.c:32:67: style: Parameter 'klass' can be declared as pointer to const [constParameterPointer] Explanation: Parameter 'klass' is marked G_GNUC_UNUSED, which expands to __attribute__((__unused__)), and the function body is empty. The function is a GObject class_init callback whose signature is set by G_DEFINE_TYPE, so suggesting const is noise. The PR now treats unused-attributed parameters as maybe-unused, which removes this false positive. ---- 42 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/v/vim/vim_9.2.0858.orig.tar.xz Result: main vim-9.2.0858/src/libvterm/t/harness.c:149:64: style: Parameter 'user' can be declared as pointer to const. However it seems that 'parser_escape' is a callback function, if 'user' is declared with const you might also need to cast function pointer(s). [constParameterCallback] vim-9.2.0858/src/libvterm/t/harness.c:295:3: note: You might need to cast the function pointer here vim-9.2.0858/src/libvterm/t/harness.c:149:64: note: Parameter 'user' can be declared as pointer to const Explanation: The parameter 'user' is declared with UNUSED, which in vim expands to __attribute__((unused)). It is a deliberately ignored callback parameter, and the function's signature has to match the callback type. Suggesting const here is noise. The PR now honours the unused attribute on parameters, so this false positive is gone. ---- 43 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/v/vim/vim_9.2.0858.orig.tar.xz Result: main vim-9.2.0858/src/libvterm/t/harness.c:342:74: style: Parameter 'user' can be declared as pointer to const. However it seems that 'scrollrect' is a callback function, if 'user' is declared with const you might also need to cast function pointer(s). [constParameterCallback] vim-9.2.0858/src/libvterm/t/harness.c:514:3: note: You might need to cast the function pointer here vim-9.2.0858/src/libvterm/t/harness.c:342:74: note: Parameter 'user' can be declared as pointer to const Explanation: The parameter is declared `void *user UNUSED`, where UNUSED expands to `__attribute__((unused))`. `scrollrect` is a callback stored in a callbacks struct, so its signature is fixed by the library interface. The parameter is deliberately unused, and suggesting const for it is noise. The PR now honors the unused attribute on parameters, so this false positive is correctly removed. ---- 44 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/v/vim/vim_9.2.0858.orig.tar.xz Result: main vim-9.2.0858/src/libvterm/t/harness.c:497:126: style: Parameter 'user' can be declared as pointer to const. However it seems that 'state_setlineinfo' is a callback function, if 'user' is declared with const you might also need to cast function pointer(s). [constParameterCallback] vim-9.2.0858/src/libvterm/t/harness.c:522:3: note: You might need to cast the function pointer here vim-9.2.0858/src/libvterm/t/harness.c:497:126: note: Parameter 'user' can be declared as pointer to const Explanation: The parameter 'user' is marked UNUSED. In vim this expands to __attribute__((unused)). The function is a callback assigned to VTermStateCallbacks, so its signature is fixed. The developer has explicitly said the parameter is intentionally unused, so suggesting a const change is noise. With the PR, the attribute after a parameter name is recognized and the variable is treated as maybe-unused, so the false positive is suppressed. ---- 45 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/v/vpnc/vpnc_0.5.3+git20260629.orig.tar.xz Result: main vpnc-0.5.3+git20260629/src/math_group.c:380:38: style: Parameter 'grp' can be declared as pointer to const. However it seems that 'modp_setraw' is a callback function, if 'grp' is declared with const you might also need to cast function pointer(s). [constParameterCallback] vpnc-0.5.3+git20260629/src/math_group.c:255:61: note: You might need to cast the function pointer here vpnc-0.5.3+git20260629/src/math_group.c:380:38: note: Parameter 'grp' can be declared as pointer to const Explanation: The parameter 'grp' in modp_setraw is marked __attribute__((unused)) and is a callback whose signature has to match the function pointer type. Suggesting const here is noise; the developer has deliberately said the parameter is unused, and changing it would require function-pointer casts. The PR now recognizes the unused attribute on parameters, so the false positive is gone. ---- 46 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/v/vpnc/vpnc_0.5.3+git20260629.orig.tar.xz Result: main vpnc-0.5.3+git20260629/src/sysdep.c:516:29: style: Parameter 'dev' can be declared as pointer to const [constParameterPointer] Explanation: The parameter 'dev' is explicitly marked __attribute__((unused)), and it is never dereferenced; the body only assigns NULL to it. tun_close also has to match a common prototype that includes the Sun variant, which uses 'dev' as a char* source for strcpy. Suggesting const here is noise the user has deliberately opted out of. The PR treats the unused attribute on parameters like maybe_unused and so suppresses the warning, as intended. ---- 47 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/w/wmix/wmix_3.5.orig.tar.gz Result: main wmix-3.5/mixer-alsa.c:37:68: style: Parameter 'elem' can be declared as pointer to const. However it seems that 'elem_callback' is a callback function, if 'elem' is declared with const you might also need to cast function pointer(s). [constParameterCallback] wmix-3.5/mixer-alsa.c:49:43: note: You might need to cast the function pointer here wmix-3.5/mixer-alsa.c:37:68: note: Parameter 'elem' can be declared as pointer to const Explanation: The parameter 'elem' is marked __attribute__((unused)), and elem_callback is passed to snd_mixer_elem_set_callback, so its signature is fixed by the ALSA API. Suggesting a const pointer for an intentionally unused callback parameter is noise. Making it const would also break the callback type match. The PR now treats __attribute__((unused)) parameters as maybe-unused, which removes this false positive. ---- 48 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/x/xfdesktop4/xfdesktop4_4.20.2.orig.tar.bz2 Result: main xfdesktop-4.20.2/common/tumbler.c:2068:56: style: Parameter 'object' can be declared as pointer to const. However it seems that 'tumbler_thumbnailer1_proxy_set_property' is a callback function, if 'object' is declared with const you might also need to cast function pointer(s). [constParameterCallback] xfdesktop-4.20.2/common/tumbler.c:2166:33: note: You might need to cast the function pointer here xfdesktop-4.20.2/common/tumbler.c:2068:56: note: Parameter 'object' can be declared as pointer to const Explanation: The parameter 'object' is marked G_GNUC_UNUSED, which expands to __attribute__((unused)). The function is an empty GObject set_property callback whose signature is fixed by GLib. Suggesting const here is noise, because the developer has explicitly marked the parameter unused. The PR now recognizes the unused attribute on parameters and suppresses the warning, matching the existing treatment of [[maybe_unused]]. Removing this false positive is an improvement. ---- 49 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/x/xfdesktop4/xfdesktop4_4.20.2.orig.tar.bz2 Result: main xfdesktop-4.20.2/common/tumbler.c:2178:66: style: Parameter 'iface' can be declared as pointer to const [constParameterPointer] Explanation: The parameter 'iface' is marked G_GNUC_UNUSED, which expands to __attribute__((__unused__)). The function is an empty GObject interface-init callback with a fixed signature, so suggesting const is noise. The PR now recognizes the unused attribute on parameters and suppresses the constParameterPointer warning, which matches the intent of the new test. This removes a false positive. ---- 50 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/y/yascreen/yascreen_2.14.orig.tar.xz Result: main yascreen-2.14/yascreen.c:1305:49: style: Parameter 's' can be declared as pointer to const [constParameterPointer] Explanation: The parameter 's' is marked __attribute__((unused)), and the function is part of a public API (yascreen_*_s), so its signature is fixed on purpose. Suggesting a const pointer for an intentionally unused parameter is noise. The PR now treats __attribute__((unused)) on parameters like [[maybe_unused]], so this false positive goes away, as the PR's own test expects.