From da706b61028d521c29b72a6cdde6e8d320f401f8 Mon Sep 17 00:00:00 2001 From: binaryFate Date: Tue, 14 Nov 2017 09:45:43 +0100 Subject: =?UTF-8?q?Fix=20false=20GCC=20warning=20'=E2=80=98*((void*)&=20su?= =?UTF-8?q?baddr=5Faccount=20+4)=E2=80=99=20may=20be=20used=20unitialized'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/wallet/wallet2.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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 subaddr_account; + // The line below is equivalent to "boost::optional 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 {return boost::none;}()); std::set subaddr_indices; // check all outputs for spending (compare key images) for(auto& in: tx.vin) -- cgit v1.2.3