]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Illumos: fix wartnings
authorPaul Floyd <pjfloyd@wanadoo.fr>
Tue, 29 Oct 2024 20:02:38 +0000 (21:02 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Tue, 29 Oct 2024 20:03:32 +0000 (21:03 +0100)
Macro redefinition, calculating the size of an array and printf
format specifiers.

callgrind/dump.c
coregrind/m_syswrap/syswrap-amd64-solaris.c
coregrind/m_syswrap/syswrap-solaris.c

index 7f9f59f92ab372909dbaa09147c4203060580c5e..130b73bd0bc8e6c080337e6e16879cd94e263cda 100644 (file)
@@ -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**))
index 8a0b3c08dfe75c099b3b312643dacf19ae35e5b7..404cba5a0a9358e984ac05101a6f47a8b3497145 100644 (file)
@@ -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",
index dad70ef857b56e2af93ab17093aebd61dddb4ba8..f43c2f30a95cf8ed15dd002f84ab1975df4a088d 100644 (file)
@@ -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);