-Wlogical-op warning in wallet/scriptpubkeyman.cpp when building current master #19912

issue kristapsk openend this issue on September 7, 2020
  1. kristapsk commented at 8:54 pm on September 7, 2020: contributor
    0wallet/scriptpubkeyman.cpp: In member function virtual bool LegacyScriptPubKeyMan::Upgrade(int, bilingual_str&):
    1wallet/scriptpubkeyman.cpp:455:55: warning: logical and applied to non-boolean constant [-Wlogical-op]
    2  455 |     if (m_storage.CanSupportFeature(FEATURE_HD_SPLIT) && CHDChain::VERSION_HD_CHAIN_SPLIT) {
    3      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    4  CXX      wallet/libbitcoin_wallet_a-wallet.o
    
    0$ gcc --version
    1gcc (Gentoo 9.2.0-r2 p3) 9.2.0
    

    Related - #19015.

  2. kristapsk added the label Bug on Sep 7, 2020
  3. practicalswift commented at 5:00 am on September 8, 2020: contributor
    Thanks for reporting! Very nice to see the recently enabled -Wlogical-op pay off. Time for -Werror=logical-op?
  4. achow101 commented at 5:26 am on September 8, 2020: member
    #18836 fixes this.
  5. practicalswift commented at 5:32 am on September 8, 2020: contributor
    @achow101 Thanks! I guess #18836 will need additional review time given its size/scope: would it make sense to patch this separately to get the fix in sooner?
  6. maskoficarus commented at 8:13 pm on September 20, 2020: none
    I’ve added a standalone fix in #19986 to get this resolved while #18836 gets sorted out.
  7. jonatack commented at 7:01 am on September 21, 2020: member

    Interesting. I compile with this flag and am not seeing this. Just reverified on both gcc and clang.

    0$ gcc --version
    1gcc (Debian 10.2.0-7) 10.2.0
    2$ clang --version
    3Debian clang version 12.0.0
    
  8. hebasto commented at 3:11 pm on October 18, 2020: member
    gcc 10.2.1 (Fedora 32) – no warnings gcc 9.3.0 (Linux Mint 20 / Ubuntu Focal) – a warning is emitted
  9. hebasto referenced this in commit 5de9689580 on Oct 18, 2020
  10. fanquake closed this on Oct 19, 2020

  11. fanquake referenced this in commit a1e0359618 on Oct 19, 2020
  12. sidhujag referenced this in commit cfc58deb8b on Oct 19, 2020
  13. Fabcien referenced this in commit a46f4c08b3 on Nov 25, 2021
  14. MarcoFalke 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: 2024-11-17 12:12 UTC

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