Page MenuHomePhabricator

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

Authored by PiRK on Dec 23 2021, 10:26.

Details

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