HomePhabricator

cast bool operands to int to silence compiler warning

Description

cast bool operands to int to silence compiler warning

Summary:
I noticed the compiler warning while running the test plan for D10725.

../src/interfaces/chain.cpp:291:20: warning: use of bitwise '&' with boolean operands [-Wbitwise-instead-of-logical]
            return FillBlock(ancestor, ancestor_out, lock) &
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is a backport of core#23573

Test Plan:

cmake .. -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
ninja all check-all

I'm using clang 14.0.0

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D10726

Details

Provenance
PiRKAuthored on Dec 22 2021, 16:21
PiRKPushed on Dec 23 2021, 13:48
Reviewer
Restricted Project
Differential Revision
D10726: cast bool operands to int to silence compiler warning
Parents
rABCe7571cd4ee84: [secp256k1]refactor: Use (int)&(int) in boolean context to avoid compiler…
Branches
Unknown
Tags
Unknown