HomePhabricator

[secp256k1]refactor: Use (int)&(int) in boolean context to avoid compiler…

Description

[secp256k1]refactor: Use (int)&(int) in boolean context to avoid compiler warning

Summary:
This fixes a compiler warning:

./src/ecdsa_impl.h:312:12: warning: use of bitwise '&' with boolean operands [-Wbitwise-instead-of-logical]
    return !secp256k1_scalar_is_zero(sigr) & !secp256k1_scalar_is_zero(sigs);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is a backport of secp256k1#1009

Test Plan:
With clang14:
ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on Nov 8 2021, 15:07
PiRKCommitted on Dec 23 2021, 13:48
PiRKPushed on Dec 23 2021, 13:48
Reviewer
Restricted Project
Differential Revision
D10735: [secp256k1]refactor: Use (int)&(int) in boolean context to avoid compiler warning
Parents
rABC3610aa71daee: Avoid signed integer overflow when loading a mempool.dat file with a malformed…
Branches
Unknown
Tags
Unknown