From: Paul Floyd Date: Thu, 29 Jan 2026 12:45:21 +0000 (+0100) Subject: Warning cleanup X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=141c2c650efd0272b0317f45f3340f33e8a00fab;p=thirdparty%2Fvalgrind.git Warning cleanup --- diff --git a/coregrind/m_syswrap/syswrap-freebsd.c b/coregrind/m_syswrap/syswrap-freebsd.c index a69fb4fb2..20e46fb5e 100644 --- a/coregrind/m_syswrap/syswrap-freebsd.c +++ b/coregrind/m_syswrap/syswrap-freebsd.c @@ -6854,16 +6854,10 @@ PRE(sys_aio_writev) // by the members of the iocb->aio_iov array // FreeBSD headers #define define this to aio_iovcnt SizeT vec_count = (SizeT)iocb->aio_nbytes; -#if defined(__clang__) -#pragma clang diagnostic push - // yes, I know it is volatile -#pragma clang diagnostic ignored "-Wcast-qual" -#endif - struct vki_iovec* p_iovec = (struct vki_iovec*)iocb->aio_buf; -#if defined(__clang__) -#pragma clang diagnostic pop -#endif - PRE_MEM_READ("aio_writev(iocb->aio_iov)", (Addr)p_iovec, vec_count*sizeof(struct vki_iovec)); + uintptr_t uint_aio_buf = (uintptr_t)iocb->aio_buf; + struct vki_iovec* p_iovec = (struct vki_iovec*)uint_aio_buf; + + PRE_MEM_READ("aio_writev(iocb->aio_iov)", uint_aio_buf, vec_count*sizeof(struct vki_iovec)); // and this to aio_iov if (ML_(safe_to_deref)(p_iovec, vec_count*sizeof(struct vki_iovec))) { diff --git a/coregrind/vgdb-invoker-freebsd.c b/coregrind/vgdb-invoker-freebsd.c index ec42ab23a..129d10a5c 100644 --- a/coregrind/vgdb-invoker-freebsd.c +++ b/coregrind/vgdb-invoker-freebsd.c @@ -203,10 +203,10 @@ Bool waitstopped (pid_t pid, int signal_expected, const char *msg) msg, signal_expected); p = waitpid(pid, &status, 0); /* PJF options was __WALL */ DEBUG(1, "after waitpid pid %d p %d status 0x%x %s\n", pid, p, - status, status_image (status)); + (unsigned)status, status_image (status)); if (p != pid) { ERROR(errno, "%s waitpid pid %d in waitstopped %d status 0x%x %s\n", - msg, pid, p, status, status_image (status)); + msg, pid, p, (unsigned)status, status_image (status)); return False; } @@ -468,7 +468,7 @@ Bool invoker_invoke_gdbserver (pid_t pid) e.g. http://sourceware.org/ml/gdb-patches/2009-11/msg00592.html */ *(long *)®_save.r_rax = *(int*)®_save.r_rax; DEBUG(1, "Sign extending %8.8lx to %8.8lx\n", - reg_mod.r_rax, reg_save.r_rax); + (unsigned long)reg_mod.r_rax, (unsigned long)reg_save.r_rax); } #elif defined(VGA_arm64) sp = reg_mod.sp; diff --git a/memcheck/tests/amd64-freebsd/scalar_arg_check.c b/memcheck/tests/amd64-freebsd/scalar_arg_check.c index cfa6d4ea0..0a847d64f 100644 --- a/memcheck/tests/amd64-freebsd/scalar_arg_check.c +++ b/memcheck/tests/amd64-freebsd/scalar_arg_check.c @@ -4,5 +4,6 @@ int main(void) { /* sendfile uses 7 args */ SY(SYS_sendfile, 101, 102, 103, 104, 105, 106, 107); + x0 = 0; } diff --git a/memcheck/tests/freebsd/Makefile.am b/memcheck/tests/freebsd/Makefile.am index ba17000c4..96c57e21e 100644 --- a/memcheck/tests/freebsd/Makefile.am +++ b/memcheck/tests/freebsd/Makefile.am @@ -249,7 +249,7 @@ openpty_LDFLAGS = ${AM_LDFLAGS} -lutil pdfork_pdkill_CFLAGS = ${AM_CFLAGS} @FLAG_W_NO_MAYBE_UNINITIALIZED@ @FLAG_W_NO_USE_AFTER_FREE@ realpathat_CFLAGS = ${AM_CFLAGS} @FLAG_W_NO_USE_AFTER_FREE@ @FLAG_W_NO_ALLOC_SIZE@ revoke_CFLAGS = ${AM_CFLAGS} @FLAG_W_NO_USE_AFTER_FREE@ -scalar_CFLAGS = ${AM_CFLAGS} -g @FLAG_W_NO_UNINITIALIZED@ +scalar_CFLAGS = ${AM_CFLAGS} -g @FLAG_W_NO_UNINITIALIZED@ @FLAG_W_NO_USE_AFTER_FREE@ scalar_abort2_CFLAGS = ${AM_CFLAGS} @FLAG_W_NO_UNINITIALIZED@ scalar_fork_CFLAGS = ${AM_CFLAGS} @FLAG_W_NO_UNUSED_VARIABLE@ scalar_pdfork_CFLAGS = ${AM_CFLAGS} @FLAG_W_NO_UNINITIALIZED@ diff --git a/memcheck/tests/x86-freebsd/scalar_arg_check.c b/memcheck/tests/x86-freebsd/scalar_arg_check.c index c608150f2..74cacd299 100644 --- a/memcheck/tests/x86-freebsd/scalar_arg_check.c +++ b/memcheck/tests/x86-freebsd/scalar_arg_check.c @@ -4,5 +4,6 @@ int main(void) { /* sendfile uses 8 args */ SY(SYS_sendfile, 101, 102, 103, 104, 105, 106, 107, 108); + x0 = 0; }