Skip to content

Commit

Permalink
Fix compile for GCC 5.1.0
Browse files Browse the repository at this point in the history
Add fix for compile error with multiple uses of peerid_type (uint64_t)
variable in lambda expression.
- known GCC issue: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65843

epee: replace return value of nullptr for expected boolean with false.

Fixes #231.
  • Loading branch information
warptangent committed May 26, 2015
1 parent 6f15194 commit 6962253
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion contrib/epee/include/storages/portable_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ namespace epee
TRY_ENTRY();
CHECK_AND_ASSERT(hsec_array, false);
if(hsec_array->type() != typeid(array_entry_t<section>))
return nullptr;
return false;
array_entry_t<section>& sec_array = boost::get<array_entry_t<section>>(*hsec_array);
h_child_section = sec_array.get_next_val();
if(!h_child_section)
Expand Down
6 changes: 5 additions & 1 deletion src/p2p/net_node.inl
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,10 @@ namespace nodetool
std::string port_=port;
peerid_type pr_ = pr;
auto cb_ = cb;*/

// GCC 5.1.0 gives error with second use of uint64_t (peerid_type) variable.
peerid_type pr_ = pr;

bool inv_call_res = epee::net_utils::async_invoke_remote_command2<COMMAND_PING::response>(ping_context.m_connection_id, COMMAND_PING::ID, req, m_net_server.get_config_object(),
[=](int code, const COMMAND_PING::response& rsp, p2p_connection_context& context)
{
Expand All @@ -1205,7 +1209,7 @@ namespace nodetool

if(rsp.status != PING_OK_RESPONSE_STATUS_TEXT || pr != rsp.peer_id)
{
LOG_PRINT_CC_L2(ping_context, "back ping invoke wrong response \"" << rsp.status << "\" from" << ip << ":" << port << ", hsh_peer_id=" << pr << ", rsp.peer_id=" << rsp.peer_id);
LOG_PRINT_CC_L2(ping_context, "back ping invoke wrong response \"" << rsp.status << "\" from" << ip << ":" << port << ", hsh_peer_id=" << pr_ << ", rsp.peer_id=" << rsp.peer_id);
return;
}
m_net_server.get_config_object().close(ping_context.m_connection_id);
Expand Down

0 comments on commit 6962253

Please sign in to comment.