Suppress -Wunterminated-string-initialization
warnings from GCC 15, like:
0In file included from src/secp256k1.c:830:
1src/modules/schnorrsig/main_impl.h:48:46: warning: initializer-string for array of 'unsigned char' truncates NUL terminator but destination lacks 'nonstring' attribute (14 chars into 13 available) [-Wunterminated-string-initialization]
2 48 | static const unsigned char bip340_algo[13] = "BIP0340/nonce";
3 | ^~~~~~~~~~~~~~~
4In file included from src/tests_exhaustive.c:28:
5src/testrand_impl.h: In function ‘testrand_seed’:
6src/testrand_impl.h:21:45: warning: initializer-string for array of ‘unsigned char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (20 chars into 19 available) [-Wunterminated-string-initialization]
7 21 | static const unsigned char PREFIX[19] = "secp256k1 test init";
8 | ^~~~~~~~~~~~~~~~~~~~~
9src/modules/ellswift/tests_impl.h:411:53: warning: initializer-string for array of ‘unsigned char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (27 chars into 26 available) [-Wunterminated-string-initialization]
10 411 | static const unsigned char bip324_tag[26] = "bip324_ellswift_xonly_ecdh";
11 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
This was fixed upstream in https://github.com/bitcoin-core/secp256k1/pull/1583, so only relevant for 28.x
and later. The code is fine, but the warnings may break builds under -Werror
, leave users wondering if there is a real issue etc.