From 20754d8dcc0568a795162667073d68821b8cc1d0 Mon Sep 17 00:00:00 2001 From: Carlos Prado Date: Sun, 10 Mar 2024 13:43:59 +0100 Subject: [PATCH] fix tauClock msan false positive on linux When running a test with memory sanitizer on linux a false possitive occurs because ts is not initialized. --- tau/tau.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tau/tau.h b/tau/tau.h index c23298b..9430caa 100644 --- a/tau/tau.h +++ b/tau/tau.h @@ -253,7 +253,7 @@ static inline double tauClock() { return TAU_CAST(double, clock()) * 1000000000 / CLOCKS_PER_SEC; // in nanoseconds #elif defined(__linux) - struct timespec ts; + struct timespec ts = {0, 0}; #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) timespec_get(&ts, TIME_UTC); #else