Author: tom
Date: 2008-01-05 00:01:20 +0000 (Sat, 05 Jan 2008)
New Revision: 7317

Log:
Fix compiler warnings by using a variable to hide the null pointer
from the compiler.

Patch from Bart Van Assche <[EMAIL PROTECTED]>.

Modified:
   trunk/memcheck/tests/execve.c
   trunk/memcheck/tests/execve.stderr.exp
   trunk/memcheck/tests/execve2.c
   trunk/memcheck/tests/execve2.stderr.exp


Modified: trunk/memcheck/tests/execve.c
===================================================================
--- trunk/memcheck/tests/execve.c       2008-01-04 23:58:32 UTC (rev 7316)
+++ trunk/memcheck/tests/execve.c       2008-01-05 00:01:20 UTC (rev 7317)
@@ -2,10 +2,11 @@
 
 int main(void)
 {
+   char* null_filename = NULL;
    char* bad[2]  = { (char*)1, NULL };
    char* good[1] = {           NULL };
 
-   execve(NULL, bad, bad);
+   execve(null_filename, bad, bad);
    execve("/bin/true", good, good);
 
    return 0;

Modified: trunk/memcheck/tests/execve.stderr.exp
===================================================================
--- trunk/memcheck/tests/execve.stderr.exp      2008-01-04 23:58:32 UTC (rev 
7316)
+++ trunk/memcheck/tests/execve.stderr.exp      2008-01-05 00:01:20 UTC (rev 
7317)
@@ -1,14 +1,14 @@
 Syscall param execve(filename) points to unaddressable byte(s)
    at 0x........: execve (in /...libc...)
-   by 0x........: main (execve.c:8)
+   by 0x........: main (execve.c:9)
  Address 0x........ is not stack'd, malloc'd or (recently) free'd
 
 Syscall param execve(argv[i]) points to unaddressable byte(s)
    at 0x........: execve (in /...libc...)
-   by 0x........: main (execve.c:8)
+   by 0x........: main (execve.c:9)
  Address 0x........ is not stack'd, malloc'd or (recently) free'd
 
 Syscall param execve(envp[i]) points to unaddressable byte(s)
    at 0x........: execve (in /...libc...)
-   by 0x........: main (execve.c:8)
+   by 0x........: main (execve.c:9)
  Address 0x........ is not stack'd, malloc'd or (recently) free'd

Modified: trunk/memcheck/tests/execve2.c
===================================================================
--- trunk/memcheck/tests/execve2.c      2008-01-04 23:58:32 UTC (rev 7316)
+++ trunk/memcheck/tests/execve2.c      2008-01-05 00:01:20 UTC (rev 7317)
@@ -3,7 +3,9 @@
 
 int main ( int argc, char** argv, char** envp )
 {
-   execve(NULL,        NULL, NULL);
+   char* null_filename = NULL;
+
+   execve(null_filename,      NULL, NULL);
    execve("../../tests/true", NULL, envp);
    assert(0);  // shouldn't get here
 }

Modified: trunk/memcheck/tests/execve2.stderr.exp
===================================================================
--- trunk/memcheck/tests/execve2.stderr.exp     2008-01-04 23:58:32 UTC (rev 
7316)
+++ trunk/memcheck/tests/execve2.stderr.exp     2008-01-05 00:01:20 UTC (rev 
7317)
@@ -1,4 +1,4 @@
 Syscall param execve(filename) points to unaddressable byte(s)
    at 0x........: execve (in /...libc...)
-   by 0x........: main (execve2.c:6)
+   by 0x........: main (execve2.c:8)
  Address 0x........ is not stack'd, malloc'd or (recently) free'd


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Valgrind-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-developers

Reply via email to