From e7c3ca0e90850697706542bae320de95a31a8d75 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Sat, 12 Aug 2017 22:46:01 +0200 Subject: [PATCH] Fix compilation warnings for -DUSE_OS_TZDB. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tz.cpp:1617:24: error: unused parameter 't' [-Werror,-Wunused-parameter] maybe_reverse_bytes(T& t, std::false_type) ^ tz.cpp:2470:1: error: unused function 'get_version' [-Werror,-Wunused-function] get_version() ^ tz.cpp: In lambda function: tz.cpp:1922:84: error: declaration of ‘t’ shadows a previous local [-Werror=shadow] [](const sys_seconds& x, const transition& t) ^ tz.cpp:1921:19: note: shadowed declaration is here for (auto t = std::upper_bound(transitions_.begin(), transitions_.end(), l, ^ --- tz.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tz.cpp b/tz.cpp index 8b5feb1..9502b9b 100644 --- a/tz.cpp +++ b/tz.cpp @@ -1614,7 +1614,7 @@ template static inline void -maybe_reverse_bytes(T& t, std::false_type) +maybe_reverse_bytes(T&, std::false_type) { } @@ -1919,9 +1919,9 @@ time_zone::init_impl() auto l = itr->date(); seconds leap_count{0}; for (auto t = std::upper_bound(transitions_.begin(), transitions_.end(), l, - [](const sys_seconds& x, const transition& t) + [](const sys_seconds& x, const transition& ct) { - return x < t.timepoint; + return x < ct.timepoint; }); t != transitions_.end(); ++t) { @@ -2465,6 +2465,7 @@ operator<<(std::ostream& os, const leap& x) #if USE_OS_TZDB +# ifdef __APPLE__ static std::string get_version() @@ -2478,6 +2479,7 @@ get_version() throw std::runtime_error("Unable to get Timezone database version from " + path); return version; } +# endif static TZ_DB