From: Paul Floyd Date: Mon, 13 Oct 2025 07:18:18 +0000 (+0200) Subject: FreeBSD syscall wrapper: fix warning X-Git-Tag: VALGRIND_3_26_0~34 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ef2d328dae99c8ee9884723f662003e930e6ba36;p=thirdparty%2Fvalgrind.git FreeBSD syscall wrapper: fix warning Was giving m_syswrap/syswrap-main.c:370:28: warning: variable 'saved' is uninitialized when passed as a const pointer argument here [-Wuninitialized-const-pointer] 370 | syscall_mask, &saved, sizeof(vki_sigset_t) | ^~~~~ Initialising it is probably the safest thing to do, but I suspect that the argument ought not to be const. Will check on that. While I'm at it, looking at how Solaris handles the carry flag it's much better than the global variable used by FreeBSD and Darwin. Will check on that as well. --- diff --git a/coregrind/m_syswrap/syswrap-main.c b/coregrind/m_syswrap/syswrap-main.c index 5919698f0..424d0a08a 100644 --- a/coregrind/m_syswrap/syswrap-main.c +++ b/coregrind/m_syswrap/syswrap-main.c @@ -350,15 +350,14 @@ void do_syscall_for_client ( Int syscallno, { vki_sigset_t saved; UWord err; -# if defined(VGO_freebsd) - Word real_syscallno; -# endif # if defined(VGO_linux) err = ML_(do_syscall_for_client_WRK)( syscallno, &tst->arch.vex, syscall_mask, &saved, sizeof(vki_sigset_t) ); # elif defined(VGO_freebsd) + Word real_syscallno; + VG_(sigemptyset)(&saved); if (tst->arch.vex.guest_SC_CLASS == VG_FREEBSD_SYSCALL0) real_syscallno = __NR_syscall; else if (tst->arch.vex.guest_SC_CLASS == VG_FREEBSD_SYSCALL198)