]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Avoid warnings caused by mixed decls and code.
authorNicholas Nethercote <njn@valgrind.org>
Sun, 12 Oct 2008 19:50:51 +0000 (19:50 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Sun, 12 Oct 2008 19:50:51 +0000 (19:50 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8665

exp-ptrcheck/tests/unaligned.c

index b7c08b0721d9f7a277d7a6b9553c421498059246..fb62ddc7697cbf2082bdec4f053d5abf283b9e34 100644 (file)
@@ -10,11 +10,16 @@ int main ( void )
    char c0[8], c1[8], c2[8], c3[8], c4[8];
 
    // Each of these pointers has a different alignment
-   char** p0 = (char**)&c0[0]; *p0 = x;
-   char** p1 = (char**)&c1[1]; *p1 = x;
-   char** p2 = (char**)&c2[2]; *p2 = x;
-   char** p3 = (char**)&c3[3]; *p3 = x;
-   char** p4 = (char**)&c4[4]; *p4 = x;
+   char** p0 = (char**)&c0[0];
+   char** p1 = (char**)&c1[1];
+   char** p2 = (char**)&c2[2];
+   char** p3 = (char**)&c3[3];
+   char** p4 = (char**)&c4[4];
+   *p0 = x;
+   *p1 = x;
+   *p2 = x;
+   *p3 = x;
+   *p4 = x;
 
    // These 10 are ok
    c = (*p0)[0];