Make memcheck/tests/clientperm clang-friendly

The use of the ternary operator was causing diffs compared to
GCC output. Switching to use two 'ifs' should remove this
difference.
This commit is contained in:
Paul Floyd 2022-05-09 09:16:48 +02:00
parent 54ee45d208
commit 1ec5d23e73
2 changed files with 9 additions and 3 deletions

View 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;
}

View 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)