"may be used uninitialized" warning in wallet/rpcwallet.cpp #20381

issue kristapsk opened this issue on November 13, 2020
  1. kristapsk commented at 5:17 AM on November 13, 2020: contributor

    Have this warning while building current master (0bd4929cd00e91bf4137f43b097cd62f72f503e4) on one test machine.

    wallet/rpcwallet.cpp: In function 'rescanblockchain()::<lambda(const RPCHelpMan&, const JSONRPCRequest&)>':
    wallet/rpcwallet.cpp:3596:19: warning: '*((void*)& stop_height +4)' may be used uninitialized in this function [-Wmaybe-uninitialized]
     3596 |     Optional<int> stop_height;
          |                   ^~~~~~~~~~~
    
    $ gcc --version
    gcc (Gentoo 9.2.0-r2 p3) 9.2.0
    Copyright (C) 2019 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
    $ uname -a
    Linux red-box 4.19.72-gentoo [#2](/bitcoin-bitcoin/2/) SMP Sun Sep 22 03:00:01 EEST 2019 x86_64 Intel(R) Pentium(R) CPU N3710 @ 1.60GHz GenuineIntel GNU/Linux
    
  2. kristapsk added the label Bug on Nov 13, 2020
  3. ryanofsky commented at 3:03 PM on November 13, 2020: member

    This can be fixed using a workaround like #18052, but the warning should be harmless, see #18198

  4. MarcoFalke removed the label Bug on Nov 13, 2020
  5. MarcoFalke added the label Wallet on Nov 13, 2020
  6. luke-jr commented at 5:15 PM on November 14, 2020: member

    Is there no way to put the workaround in the constructor?

  7. MarcoFalke referenced this in commit 0ede354367 on Nov 15, 2020
  8. MarcoFalke closed this on Nov 15, 2020

  9. sidhujag referenced this in commit 1fecc4ecc9 on Nov 16, 2020
  10. DrahtBot locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 15:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me