From: Paul Floyd Date: Tue, 29 Oct 2024 20:02:38 +0000 (+0100) Subject: Illumos: fix wartnings X-Git-Tag: VALGRIND_3_24_0~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=688f35dfdb5cc628a5c202069835a9a1390923a2;p=thirdparty%2Fvalgrind.git Illumos: fix wartnings Macro redefinition, calculating the size of an array and printf format specifiers. --- diff --git a/callgrind/dump.c b/callgrind/dump.c index 7f9f59f92a..130b73bd0b 100644 --- a/callgrind/dump.c +++ b/callgrind/dump.c @@ -895,7 +895,9 @@ void swap(BBCC** a, BBCC** b) t = *a; *a = *b; *b = t; } +#if !defined(min) #define min(x, y) ((x)<=(y) ? (x) : (y)) +#endif static BBCC** med3(BBCC **a, BBCC **b, BBCC **c, int (*cmp)(BBCC**,BBCC**)) diff --git a/coregrind/m_syswrap/syswrap-amd64-solaris.c b/coregrind/m_syswrap/syswrap-amd64-solaris.c index 8a0b3c08df..404cba5a0a 100644 --- a/coregrind/m_syswrap/syswrap-amd64-solaris.c +++ b/coregrind/m_syswrap/syswrap-amd64-solaris.c @@ -233,7 +233,7 @@ void ML_(save_machine_context)(ThreadId tid, vki_ucontext_t *uc, buf[2] = VKI_UC_GUEST_CC_DEP1(uc); buf[3] = VKI_UC_GUEST_CC_DEP2(uc); buf[4] = uc->uc_mcontext.gregs[VKI_REG_RFL]; - checksum = ML_(fletcher64)((UInt*)&buf, sizeof(buf) / sizeof(UInt)); + checksum = ML_(fletcher64)((UInt*)&buf, 2 * sizeof(buf) / sizeof(buf[0])); VKI_UC_GUEST_RFLAGS_CHECKSUM(uc) = checksum; } @@ -439,7 +439,7 @@ void ML_(restore_machine_context)(ThreadId tid, vki_ucontext_t *uc, buf[3] = VKI_UC_GUEST_CC_DEP2(uc); buf[4] = rflags; checksum = ML_(fletcher64)((UInt*)&buf, - sizeof(buf) / sizeof(UInt)); + 2 * sizeof(buf) / sizeof(buf[0])); if (checksum == VKI_UC_GUEST_RFLAGS_CHECKSUM(uc)) { /* Check ok, the full restoration is possible. */ VG_(debugLog)(1, "syswrap-solaris", diff --git a/coregrind/m_syswrap/syswrap-solaris.c b/coregrind/m_syswrap/syswrap-solaris.c index dad70ef857..f43c2f30a9 100644 --- a/coregrind/m_syswrap/syswrap-solaris.c +++ b/coregrind/m_syswrap/syswrap-solaris.c @@ -3930,7 +3930,7 @@ PRE(sys_execve) #if defined(SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS) if (ARG1_is_fd) VG_(message)(Vg_UserMsg, "execve(%ld, %#lx, %#lx, %lu) failed, " - "errno %ld\n", SARG1, ARG2, ARG3, ARG4, ERR); + "errno %lu\n", SARG1, ARG2, ARG3, ARG4, ERR); else VG_(message)(Vg_UserMsg, "execve(%#lx(%s), %#lx, %#lx, %ld) failed, errno" " %lu\n", ARG1, (HChar *) ARG1, ARG2, ARG3, SARG4, ERR);