From: Paul Floyd Date: Mon, 9 May 2022 07:16:48 +0000 (+0200) Subject: Make memcheck/tests/clientperm clang-friendly X-Git-Tag: VALGRIND_3_20_0~90 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ec5d23e7386e6f2687f0f2087fbbc1a0c0e945b;p=thirdparty%2Fvalgrind.git 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. --- diff --git a/memcheck/tests/clientperm.c b/memcheck/tests/clientperm.c index ac7574788d..12e2123fca 100644 --- a/memcheck/tests/clientperm.c +++ b/memcheck/tests/clientperm.c @@ -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; } diff --git a/memcheck/tests/clientperm.stderr.exp b/memcheck/tests/clientperm.stderr.exp index cb838c9ed8..76c4f5cab1 100644 --- a/memcheck/tests/clientperm.stderr.exp +++ b/memcheck/tests/clientperm.stderr.exp @@ -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)