aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbinaryFate <binaryfate@users.noreply.github.com>2017-11-14 09:45:43 +0100
committerbinaryFate <binaryfate@users.noreply.github.com>2017-11-14 09:45:43 +0100
commitda706b61028d521c29b72a6cdde6e8d320f401f8 (patch)
tree7b816abd4b7e5b3e748601a5ca2cacc665f74d2e /src
parentMerge pull request #2694 (diff)
downloadmonero-da706b61028d521c29b72a6cdde6e8d320f401f8.tar.xz
Fix false GCC warning '‘*((void*)& subaddr_account +4)’ may be used unitialized'
Diffstat (limited to 'src')
-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 a87803206..ab059d572 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -1049,7 +1049,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)