]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Make badrw.c conform to C89; split things onto separate lines so it's
authorJeremy Fitzhardinge <jeremy@valgrind.org>
Wed, 7 Jan 2004 08:47:03 +0000 (08:47 +0000)
committerJeremy Fitzhardinge <jeremy@valgrind.org>
Wed, 7 Jan 2004 08:47:03 +0000 (08:47 +0000)
clear what the messages are talking about.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2192

addrcheck/tests/badrw.stderr.exp
memcheck/tests/badrw.c
memcheck/tests/badrw.stderr.exp

index a6f168c7b2414b225104ecba1965bb0a826c0a07..77c3f4a21c0e4f85d2766a9b72023e86f4208474 100644 (file)
@@ -1,35 +1,35 @@
 Invalid read of size 4
-   at 0x........: main (badrw.c:12)
+   at 0x........: main (badrw.c:19)
  Address 0x........ is 4 bytes before a block of size 10 alloc'd
    at 0x........: malloc (vg_replace_malloc.c:...)
    by 0x........: main (badrw.c:5)
 
 Invalid write of size 4
-   at 0x........: main (badrw.c:12)
+   at 0x........: main (badrw.c:20)
  Address 0x........ is 4 bytes before a block of size 10 alloc'd
    at 0x........: malloc (vg_replace_malloc.c:...)
    by 0x........: main (badrw.c:5)
 
 Invalid read of size 2
-   at 0x........: main (badrw.c:13)
+   at 0x........: main (badrw.c:22)
  Address 0x........ is 4 bytes before a block of size 10 alloc'd
    at 0x........: malloc (vg_replace_malloc.c:...)
    by 0x........: main (badrw.c:5)
 
 Invalid write of size 2
-   at 0x........: main (badrw.c:13)
+   at 0x........: main (badrw.c:23)
  Address 0x........ is 4 bytes before a block of size 10 alloc'd
    at 0x........: malloc (vg_replace_malloc.c:...)
    by 0x........: main (badrw.c:5)
 
 Invalid read of size 1
-   at 0x........: main (badrw.c:14)
+   at 0x........: main (badrw.c:25)
  Address 0x........ is 1 bytes before a block of size 10 alloc'd
    at 0x........: malloc (vg_replace_malloc.c:...)
    by 0x........: main (badrw.c:5)
 
 Invalid write of size 1
-   at 0x........: main (badrw.c:14)
+   at 0x........: main (badrw.c:26)
  Address 0x........ is 1 bytes before a block of size 10 alloc'd
    at 0x........: malloc (vg_replace_malloc.c:...)
    by 0x........: main (badrw.c:5)
index b72f39361bd9c3160ec11367d8866d604c5d3237..d711ec969b771c4795f0580bfe29e2cf43fd3bfb 100644 (file)
@@ -4,14 +4,26 @@ int main(void)
 {
    void* x = malloc(10);
 
-   int*        x4 = x-4;
-   short int*  x2 = x-4;
-   char*       x1 = x-1;
+   int   *x4;
+   short *x2;
+   char  *x1;
+   int    y4;
+   short  y2;
+   char   y1;
+
+   x4 = x-4;
+   x2 = x-4;
+   x1 = x-1;
 
    // Invalid reads and writes of sizes 4, 2, 1
-   int       y4 = *x4;  *x4 = y4;
-   short int y2 = *x2;  *x2 = y2;
-   char      y1 = *x1;  *x1 = y1;
+   y4 = *x4;
+   *x4 = y4;
+
+   y2 = *x2;
+   *x2 = y2;
+
+   y1 = *x1;
+   *x1 = y1;
    
    return 0;
 }
index a6f168c7b2414b225104ecba1965bb0a826c0a07..77c3f4a21c0e4f85d2766a9b72023e86f4208474 100644 (file)
@@ -1,35 +1,35 @@
 Invalid read of size 4
-   at 0x........: main (badrw.c:12)
+   at 0x........: main (badrw.c:19)
  Address 0x........ is 4 bytes before a block of size 10 alloc'd
    at 0x........: malloc (vg_replace_malloc.c:...)
    by 0x........: main (badrw.c:5)
 
 Invalid write of size 4
-   at 0x........: main (badrw.c:12)
+   at 0x........: main (badrw.c:20)
  Address 0x........ is 4 bytes before a block of size 10 alloc'd
    at 0x........: malloc (vg_replace_malloc.c:...)
    by 0x........: main (badrw.c:5)
 
 Invalid read of size 2
-   at 0x........: main (badrw.c:13)
+   at 0x........: main (badrw.c:22)
  Address 0x........ is 4 bytes before a block of size 10 alloc'd
    at 0x........: malloc (vg_replace_malloc.c:...)
    by 0x........: main (badrw.c:5)
 
 Invalid write of size 2
-   at 0x........: main (badrw.c:13)
+   at 0x........: main (badrw.c:23)
  Address 0x........ is 4 bytes before a block of size 10 alloc'd
    at 0x........: malloc (vg_replace_malloc.c:...)
    by 0x........: main (badrw.c:5)
 
 Invalid read of size 1
-   at 0x........: main (badrw.c:14)
+   at 0x........: main (badrw.c:25)
  Address 0x........ is 1 bytes before a block of size 10 alloc'd
    at 0x........: malloc (vg_replace_malloc.c:...)
    by 0x........: main (badrw.c:5)
 
 Invalid write of size 1
-   at 0x........: main (badrw.c:14)
+   at 0x........: main (badrw.c:26)
  Address 0x........ is 1 bytes before a block of size 10 alloc'd
    at 0x........: malloc (vg_replace_malloc.c:...)
    by 0x........: main (badrw.c:5)