From ff342a5ba68f4f0e16d876af2020a88da916b377 Mon Sep 17 00:00:00 2001 From: iphydf Date: Sat, 11 Aug 2018 12:56:39 +0000 Subject: [PATCH] Force storing the result of crypto_memcmp in the test. So we don't accidentally elide the call given that it's a pure function and its result isn't used. --- toxcore/crypto_core_test.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toxcore/crypto_core_test.cc b/toxcore/crypto_core_test.cc index 1fbdd296..cdc315b2 100644 --- a/toxcore/crypto_core_test.cc +++ b/toxcore/crypto_core_test.cc @@ -29,7 +29,8 @@ enum { clock_t memcmp_time(void *a, void *b, size_t len) { clock_t start = clock(); - crypto_memcmp(a, b, len); + volatile int result = crypto_memcmp(a, b, len); + (void)result; return clock() - start; }