[Bug runtime/32695] The static array size of STAP_KPROBE_PROBE_STR_module cause -Werror=string-compare with GCC-15

wcohen at redhat dot com sourceware-bugzilla@sourceware.org
Fri Feb 14 16:57:44 GMT 2025


https://sourceware.org/bugzilla/show_bug.cgi?id=32695

--- Comment #1 from William Cohen <wcohen at redhat dot com> ---
It looks like this can be address with 

diff --git a/runtime/linux/kprobes.c b/runtime/linux/kprobes.c
index 9ae5565e3..09d5c7a31 100644
--- a/runtime/linux/kprobes.c
+++ b/runtime/linux/kprobes.c
@@ -800,6 +800,8 @@ stapkp_init(struct stap_kprobe_probe *probes,
       if (rc == 1) // failed to relocate addr?
          continue; // don't fuss about it, module probably not loaded

+      // PR32695 gcc might statically determine the strcmp will nevery match
+#pragma GCC diagnostic ignored "-Wstring-compare"
       // NB: We keep going even if a probe failed to register (PR6749). We
only
       // warn about it if it wasn't optional and isn't in a module.
       if (rc && !skp->optional_p

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Systemtap mailing list