From d4f7731b612f66bf726ba18c6cd7545b28c11769 Mon Sep 17 00:00:00 2001 From: Maysam Yabandeh Date: Thu, 8 Jun 2017 10:38:45 -0700 Subject: [PATCH] fix travis error with init time in mockenv MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: /home/travis/build/facebook/rocksdb/env/mock_env.cc: In member function ‘virtual void rocksdb::{anonymous}::TestMemLogger::Logv(const char*, va_list)’: /home/travis/build/facebook/rocksdb/env/mock_env.cc:391:53: error: ‘t.tm::tm_year’ may be used uninitialized in this function [-Werror=maybe-uninitialized] static_cast(now_tv.tv_usec)); Closes https://github.com/facebook/rocksdb/pull/2418 Differential Revision: D5193597 Pulled By: maysamyabandeh fbshipit-source-id: 8801a3ef27f33eb419d534f7de747702cdf504a0 --- env/mock_env.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/env/mock_env.cc b/env/mock_env.cc index 8868b358d..66ecfeff3 100644 --- a/env/mock_env.cc +++ b/env/mock_env.cc @@ -379,7 +379,8 @@ class TestMemLogger : public Logger { gettimeofday(&now_tv, nullptr); const time_t seconds = now_tv.tv_sec; struct tm t; - localtime_r(&seconds, &t); + auto ret __attribute__((__unused__)) = localtime_r(&seconds, &t); + assert(ret); p += snprintf(p, limit - p, "%04d/%02d/%02d-%02d:%02d:%02d.%06d ", t.tm_year + 1900,