Page MenuHomePhabricator

Add a message to static_assert

Authored by Fabien on Fri, Aug 2, 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.Fri, Aug 2, 07:37
Herald added a reviewer: Restricted Project. · View Herald TranscriptFri, Aug 2, 07:37
jasonbcox requested changes to this revision.Fri, Aug 2, 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.Fri, Aug 2, 17:05
Fabien updated this revision to Diff 10582.Fri, Aug 2, 18:01

Improve message wording;

deadalnix accepted this revision.Sat, Aug 3, 07:20
markblundeberg added a subscriber: markblundeberg.EditedSun, Aug 4, 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.Sun, Aug 4, 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.Mon, Aug 5, 07:26

@Mengerian LGTM, will update accordingly.

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

Rebase and use a more technical and accurate message.

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

Wording now looks good to me

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