aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-11-25 19:51:28 +0200
committerRiccardo Spagni <ric@spagni.net>2017-11-25 19:51:28 +0200
commit82375f7de7d1602ac9cef0e6c478f3e4bea3f41e (patch)
treeebc62ac7c29e6554798bb52722f184511b3ead34
parentMerge pull request #2800 (diff)
parentFix false GCC warning '‘*((void*)& subaddr_account +4)’ may be used uniti... (diff)
downloadmonero-82375f7de7d1602ac9cef0e6c478f3e4bea3f41e.tar.xz
Merge pull request #2806
da706b61 Fix false GCC warning '‘*((void*)& subaddr_account +4)’ may be used unitialized' (binaryFate)
-rw-r--r--src/wallet/wallet2.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 91c216a49..fdaac5e70 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -1080,7 +1080,9 @@ void wallet2::process_new_transaction(const crypto::hash &txid, const cryptonote
}
uint64_t tx_money_spent_in_ins = 0;
- boost::optional<uint32_t> subaddr_account;
+ // The line below is equivalent to "boost::optional<uint32_t> subaddr_account;", but avoids the GCC warning: ‘*((void*)& subaddr_account +4)’ may be used uninitialized in this function
+ // It's a GCC bug with boost::optional, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47679
+ auto subaddr_account ([]()->boost::optional<uint32_t> {return boost::none;}());
std::set<uint32_t> subaddr_indices;
// check all outputs for spending (compare key images)
for(auto& in: tx.vin)