Page MenuHomePhabricator

Add a message to static_assert

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



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

rABC Bitcoin ABC
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien created this revision.Aug 2 2019, 07:37
Herald added a reviewer: Restricted Project. · View Herald TranscriptAug 2 2019, 07:37
jasonbcox requested changes to this revision.Aug 2 2019, 17:05
jasonbcox added a subscriber: jasonbcox.
jasonbcox added inline comments.
1030 ↗(On Diff #10575)

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
Fabien updated this revision to Diff 10582.Aug 2 2019, 18:01

Improve message wording;

deadalnix accepted this revision.Aug 3 2019, 07:20
markblundeberg added a subscriber: markblundeberg.EditedAug 4 2019, 00:50

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.

Fabien added a comment.Aug 4 2019, 07:48

@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."

Fabien added a comment.Aug 5 2019, 07:26

@Mengerian LGTM, will update accordingly.

Fabien updated this revision to Diff 10603.Aug 5 2019, 07:31

Rebase and use a more technical and accurate message.

jasonbcox accepted this revision.Aug 5 2019, 15:42
This revision is now accepted and ready to land.Aug 5 2019, 15:42
Mengerian accepted this revision.Aug 5 2019, 20:14

Wording now looks good to me

markblundeberg accepted this revision.Aug 5 2019, 23:15
This revision was automatically updated to reflect the committed changes.