From 08d356859ca76420df4a9a58c4ef283a963872f5 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Sat, 7 Sep 2019 13:57:15 +0800 Subject: [PATCH] Work around false-positive warning with g++ 8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit skyaware978_main.cc: In function ‘int realmain(int, char**)’: skyaware978_main.cc:106:48: error: ‘*((void*)(& location)+8).std::pair::second’ may be used uninitialized in this function [-Werror=maybe-uninitialized] boost::optional> location = boost::none; Fixes #2 --- skyaware978_main.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skyaware978_main.cc b/skyaware978_main.cc index 85e31a2..0f05b43 100644 --- a/skyaware978_main.cc +++ b/skyaware978_main.cc @@ -103,7 +103,7 @@ static int realmain(int argc, char **argv) { } }); - boost::optional> location = boost::none; + boost::optional> location = boost::make_optional(false, std::make_pair(0.0, 0.0)); if (opts.count("lat") && opts.count("lon")) { location.emplace(opts["lat"].as(), opts["lon"].as()); }