]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Make memcheck/tests/clientperm clang-friendly
authorPaul Floyd <pjfloyd@wanadoo.fr>
Mon, 9 May 2022 07:16:48 +0000 (09:16 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Mon, 9 May 2022 07:16:48 +0000 (09:16 +0200)
The use of the ternary operator was causing diffs compared to
GCC output. Switching to use two 'ifs' should remove this
difference.

memcheck/tests/clientperm.c
memcheck/tests/clientperm.stderr.exp

index ac7574788d2480ea784d03963b21c9cccb7d7d92..12e2123fca0f75c3bcb24a93b73d47b5be234a89 100644 (file)
@@ -26,14 +26,20 @@ int main ( void )
 
    for (i = 0; i < 100; i++)
      sum += aa[i];
-   printf("sum is %s\n", sum > 0 ? "positive" : "non-positive");
+   if (sum > 0)
+      printf("sum is positive\n");
+   else
+      printf("sum is non-positive\n");
 
    m = VALGRIND_DISCARD(m);
    printf("m_rm: returned value is %d\n", m );
 
    for (i = 0; i < 100; i++)
      sum += aa[i];
-   printf("sum is %s\n", sum > 0 ? "positive" : "non-positive");
+   if (sum > 0)
+      printf("sum is positive\n");
+   else
+      printf("sum is non-positive\n");
 
    return 0;
 }
index cb838c9ed8fb774e5f5dd695053b092f26e236cc..76c4f5cab15e1e3b16a901e4e1903f2c59fd3ad7 100644 (file)
@@ -2,5 +2,5 @@ Conditional jump or move depends on uninitialised value(s)
    at 0x........: main (clientperm.c:29)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (clientperm.c:36)
+   at 0x........: main (clientperm.c:39)