From ef2d328dae99c8ee9884723f662003e930e6ba36 Mon Sep 17 00:00:00 2001 From: Paul Floyd Date: Mon, 13 Oct 2025 09:18:18 +0200 Subject: [PATCH] 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. --- coregrind/m_syswrap/syswrap-main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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) -- 2.47.3