Skip to content

Conversation

@hebasto
Copy link
Member

@hebasto hebasto commented Feb 1, 2020

On master (f05c1ac) GCC compiler fires a false positive -Wmaybe-uninitialized:

wallet/wallet.cpp: In static member function ‘static std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain&, const WalletLocation&, std::__cxx11::string&, std::vector<std::__cxx11::basic_string<char> >&, uint64_t)’:
wallet/wallet.cpp:3913:27: warning: ‘*((void*)& time_first_key +8)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         Optional<int64_t> time_first_key;
                           ^~~~~~~~~~~~~~

The same as #15292.

This PR leverages a workaround and removes the warning.

@hebasto hebasto requested a review from achow101 February 1, 2020 21:17
@fanquake fanquake added the Wallet label Feb 1, 2020
Copy link
Contributor

@kristapsk kristapsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK e9434ee

@DrahtBot
Copy link
Contributor

DrahtBot commented Feb 2, 2020

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

No conflicts as of last run.

@laanwj
Copy link
Member

laanwj commented Feb 5, 2020

ACK e9434ee, removes the warning for me (gcc 7.4.0)

laanwj added a commit that referenced this pull request Feb 5, 2020
e9434ee Remove false positive GCC warning (Hennadii Stepanov)

Pull request description:

  On master (f05c1ac) GCC compiler fires a false positive `-Wmaybe-uninitialized`:

  ```
  wallet/wallet.cpp: In static member function ‘static std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain&, const WalletLocation&, std::__cxx11::string&, std::vector<std::__cxx11::basic_string<char> >&, uint64_t)’:
  wallet/wallet.cpp:3913:27: warning: ‘*((void*)& time_first_key +8)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
           Optional<int64_t> time_first_key;
                             ^~~~~~~~~~~~~~
  ```

  The same as #15292.

  This PR leverages a workaround and removes the warning.

ACKs for top commit:
  laanwj:
    ACK e9434ee, removes the warning for me (gcc 7.4.0)
  kristapsk:
    ACK e9434ee

Tree-SHA512: 8820a8ba6a75aa6b1ac675a38c883a77f12968b010533b6383180aa66e7e0d570bf6300744903ead91cf9084e5345144959cd6b0cea1b763190b8dd49bacce75
@laanwj laanwj merged commit e9434ee into bitcoin:master Feb 5, 2020
@hebasto hebasto deleted the 20200201-false-positive-warning branch February 5, 2020 13:45
@ddustin
Copy link

ddustin commented Feb 5, 2020

Looks like we got a bonus semicolon

sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Feb 9, 2020
e9434ee Remove false positive GCC warning (Hennadii Stepanov)

Pull request description:

  On master (f05c1ac) GCC compiler fires a false positive `-Wmaybe-uninitialized`:

  ```
  wallet/wallet.cpp: In static member function ‘static std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain&, const WalletLocation&, std::__cxx11::string&, std::vector<std::__cxx11::basic_string<char> >&, uint64_t)’:
  wallet/wallet.cpp:3913:27: warning: ‘*((void*)& time_first_key +8)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
           Optional<int64_t> time_first_key;
                             ^~~~~~~~~~~~~~
  ```

  The same as bitcoin#15292.

  This PR leverages a workaround and removes the warning.

ACKs for top commit:
  laanwj:
    ACK e9434ee, removes the warning for me (gcc 7.4.0)
  kristapsk:
    ACK e9434ee

Tree-SHA512: 8820a8ba6a75aa6b1ac675a38c883a77f12968b010533b6383180aa66e7e0d570bf6300744903ead91cf9084e5345144959cd6b0cea1b763190b8dd49bacce75
jasonbcox pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Oct 10, 2020
…oops

Summary:
Add wallet logic for dealing with multiple ScriptPubKeyMan instances. This
doesn't change current behavior because there is still only a single
LegacyScriptPubKeyMan. But in the future the new logic will be used to support
descriptor wallets.

---

bitcoin/bitcoin@c729afd

Note: Had to bring in [[bitcoin/bitcoin#18052 | PR18052]] to fix an instance of -Wmaybe-uninitialized

Depends on D7858

Partial backport of Core [[bitcoin/bitcoin#17261 | PR17261]] and [[bitcoin/bitcoin#18052 | PR18052]]

Test Plan:
  ninja all check check-functional

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D7859
sidhujag pushed a commit to syscoin-core/syscoin that referenced this pull request Nov 10, 2020
e9434ee Remove false positive GCC warning (Hennadii Stepanov)

Pull request description:

  On master (f05c1ac) GCC compiler fires a false positive `-Wmaybe-uninitialized`:

  ```
  wallet/wallet.cpp: In static member function ‘static std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain&, const WalletLocation&, std::__cxx11::string&, std::vector<std::__cxx11::basic_string<char> >&, uint64_t)’:
  wallet/wallet.cpp:3913:27: warning: ‘*((void*)& time_first_key +8)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
           Optional<int64_t> time_first_key;
                             ^~~~~~~~~~~~~~
  ```

  The same as bitcoin#15292.

  This PR leverages a workaround and removes the warning.

ACKs for top commit:
  laanwj:
    ACK e9434ee, removes the warning for me (gcc 7.4.0)
  kristapsk:
    ACK e9434ee

Tree-SHA512: 8820a8ba6a75aa6b1ac675a38c883a77f12968b010533b6383180aa66e7e0d570bf6300744903ead91cf9084e5345144959cd6b0cea1b763190b8dd49bacce75
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants