Skip to content

Commit

Permalink
Work around false-positive warning with g++ 8
Browse files Browse the repository at this point in the history
skyaware978_main.cc: In function ‘int realmain(int, char**)’:
skyaware978_main.cc:106:48: error: ‘*((void*)(& location)+8).std::pair<double, double>::second’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     boost::optional<std::pair<double, double>> location = boost::none;

Fixes flightaware#2
  • Loading branch information
mutability committed Sep 7, 2019
1 parent 5a79460 commit 08d3568
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion skyaware978_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static int realmain(int argc, char **argv) {
}
});

boost::optional<std::pair<double, double>> location = boost::none;
boost::optional<std::pair<double, double>> location = boost::make_optional(false, std::make_pair(0.0, 0.0));
if (opts.count("lat") && opts.count("lon")) {
location.emplace(opts["lat"].as<double>(), opts["lon"].as<double>());
}
Expand Down

0 comments on commit 08d3568

Please sign in to comment.