From 8e1823d6f59c1d0fdc084fd903c989e6816ea097 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 11 Jun 2024 05:37:35 -0700 Subject: [PATCH] cycleclock: Fix type conversion to match function return type on riscv64 (#1802) Fixes builds with clang src/cycleclock.h:213:10: error: implicit conversion changes signedness: 'uint64_t' (aka 'unsigned long') to 'int64_t' (aka 'long') [-Werror,-Wsign-conversion] 213 | return cycles; | ~~~~~~ ^~~~~~ 1 error generated. --- src/cycleclock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cycleclock.h b/src/cycleclock.h index c657414e..bd62f5d7 100644 --- a/src/cycleclock.h +++ b/src/cycleclock.h @@ -210,7 +210,7 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() { #else uint64_t cycles; asm volatile("rdtime %0" : "=r"(cycles)); - return cycles; + return static_cast(cycles); #endif #elif defined(__e2k__) || defined(__elbrus__) struct timeval tv;