]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Solaris: Fix GCC -Waddress warnings
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sat, 14 Mar 2026 17:10:18 +0000 (18:10 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sat, 14 Mar 2026 17:10:18 +0000 (18:10 +0100)
Also fix a warning in one regtest coming from setitimer.
With XOPEN < 500 it uses an old prototype without a const 2nd argument.

coregrind/m_syswrap/syswrap-solaris.c
none/tests/bug492678.c

index b122d9627ea3bbd4cad5ca131b89ec94c579ddff..c5058868e6c4686f8dab7670db13e9180cd96ef8 100644 (file)
@@ -1645,7 +1645,7 @@ static Bool handle_auxv_open(SyscallStatus *status, const HChar *filename,
 
    /* Opening /proc/<pid>/auxv or /proc/self/auxv? */
    VG_(sprintf)(name, "/proc/%d/auxv", VG_(getpid)());
-   if (!VG_STREQ(filename, name) && !VG_STREQ(filename, "/proc/self/auxv"))
+   if ((VG_(strcmp)(filename, name)!=0) && (VG_(strcmp)(filename, "/proc/self/auxv")!=0))
       return False;
 
    /* Allow to open the file only for reading. */
@@ -1682,7 +1682,7 @@ static Bool handle_psinfo_open(SyscallStatus *status,
    HChar name[VKI_PATH_MAX];    // large enough
    VG_(sprintf)(name, "/proc/%d/psinfo", VG_(getpid)());
 
-   if (!VG_STREQ(filename, name) && !VG_STREQ(filename, "/proc/self/psinfo"))
+   if ((VG_(strcmp)(filename, name)!=0) && (VG_(strcmp)(filename, "/proc/self/psinfo")!=0))
       return False;
 
    /* Use original arguments to open() or openat(). */
index 8c3689fc3c39ef8b11bdf565da11a63cea34546b..ddb00f9dc3f445c6bcb48580c5e23a258ac433fc 100644 (file)
@@ -1,3 +1,4 @@
+#define _XOPEN_SOURCE 500
 #include <errno.h>
 #include <signal.h>
 #include <stdio.h>