Page MenuHomePhabricator

Add a message to static_assert
ClosedPublic

Authored by Fabien on Aug 2 2019, 07:37.

Details

Summary

static_assert with no message is a c++17 feature, and causes clang to
generate a -Wc++17-extensions warning.

Test Plan

With Clang:

make check

Diff Detail

Repository
rABC Bitcoin ABC
Branch
fix_static_assert_without_message
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 7032
Build 12111: Bitcoin ABC Buildbot (legacy)
Build 12110: arc lint + arc unit

Event Timeline

jasonbcox requested changes to this revision.Aug 2 2019, 17:05
jasonbcox added a subscriber: jasonbcox.
jasonbcox added inline comments.
src/script/interpreter.cpp
1030

Using the affirmative in this way in an error message reads strangely. I recommend "Schnorr multisig only supports up to 31 pubkeys."

This revision now requires changes to proceed.Aug 2 2019, 17:05

Improve message wording;

Note -- it only supports up to 20 pubkeys like regular multisig, rather this static assert is only here since the implementation's usage of a 32-bit number (and >> operator) is implicitly assuming < 32 keys.

@markblundeberg What do you think of rewording the message with a slightly more technical content then ?:
Schnorr multisig is limited by the checkbits size to 31 pubkeys.

@Fabien @markblundeberg How about this: "Schnorr multisig checkbits implementation assumes < 32 pubkeys."

Rebase and use a more technical and accurate message.

This revision is now accepted and ready to land.Aug 5 2019, 15:42

Wording now looks good to me

This revision was automatically updated to reflect the committed changes.