From 1ec5d23e7386e6f2687f0f2087fbbc1a0c0e945b Mon Sep 17 00:00:00 2001 From: Paul Floyd Date: Mon, 9 May 2022 09:16:48 +0200 Subject: [PATCH] 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. --- memcheck/tests/clientperm.c | 10 ++++++++-- memcheck/tests/clientperm.stderr.exp | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/memcheck/tests/clientperm.c b/memcheck/tests/clientperm.c index ac7574788..12e2123fc 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 cb838c9ed..76c4f5cab 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)