From 994f192636431fb6a0e0d9d9371a437d04e19519 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 19 Mar 2019 21:11:21 +0100 Subject: [PATCH] Fix warning if put_time is not present --- src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc index 7b58f31ae..54ca099a5 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc @@ -366,10 +366,10 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, // Display time in local time zone d_show_local_time_zone = conf_.show_local_time_zone; - time_t when = std::time(nullptr); - auto const tm = *std::localtime(&when); std::ostringstream os; #ifdef HAS_PUT_TIME + time_t when = std::time(nullptr); + auto const tm = *std::localtime(&when); os << std::put_time(&tm, "%z"); #endif std::string utc_diff_str = os.str(); // in ISO 8601 format: "+HHMM" or "-HHMM"