Skip to content

Commit 7fc15db

Browse files
committed
[28.x] build: suppress -Wunterminated-string-initialization in secp
Suppress `-Wunterminated-string-initialization` warnings from GCC 15, like: ```bash In file included from src/secp256k1.c:830: src/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] 48 | static const unsigned char bip340_algo[13] = "BIP0340/nonce"; | ^~~~~~~~~~~~~~~ In file included from src/tests_exhaustive.c:28: src/testrand_impl.h: In function ‘testrand_seed’: src/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] 21 | static const unsigned char PREFIX[19] = "secp256k1 test init"; | ^~~~~~~~~~~~~~~~~~~~~ ``` This was fixed upstream in bitcoin-core/secp256k1#1583.
1 parent a124b91 commit 7fc15db

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

configure.ac

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,6 +1690,9 @@ CPPFLAGS_TEMP="$CPPFLAGS"
16901690
unset CPPFLAGS
16911691
CPPFLAGS="$CPPFLAGS_TEMP"
16921692

1693+
1694+
AX_CHECK_COMPILE_FLAG([-Wno-unterminated-string-initialization], [export SECP_CFLAGS="$SECP_CFLAGS -Wno-unterminated-string-initialization"], [], [$CXXFLAG_WERROR])
1695+
16931696
if test -n "$use_sanitizers"; then
16941697
export SECP_CFLAGS="$SECP_CFLAGS $SANITIZER_CFLAGS"
16951698
fi

0 commit comments

Comments
 (0)