Compiling master at e1bf5470f919cf212703466411968916db8ae61f on Ubuntu 22.10 (with depends):
0 CXX test/test_bitcoin-dbwrapper_tests.o
1test/dbwrapper_tests.cpp: In member function ‘void dbwrapper_tests::iterator_string_ordering::test_method()’:
2test/dbwrapper_tests.cpp:365:41: error: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 10 [-Werror=format-truncation=]
3 365 | snprintf(buf, sizeof(buf), "%d", x);
4 | ^~
5test/dbwrapper_tests.cpp:365:40: note: directive argument in the range [-2147483648, 9]
6 365 | snprintf(buf, sizeof(buf), "%d", x);
7 | ^~~~
8In file included from /usr/include/stdio.h:906,
9 from /usr/include/c++/12/cstdio:42,
10 from /usr/include/c++/12/ext/string_conversions.h:43,
11 from /usr/include/c++/12/bits/basic_string.h:3960,
12 from /usr/include/c++/12/string:53,
13 from ./clientversion.h:30,
14 from ./dbwrapper.h:8,
15 from test/dbwrapper_tests.cpp:5:
16In function ‘int snprintf(char*, size_t, const char*, ...)’,
17 inlined from ‘void dbwrapper_tests::iterator_string_ordering::test_method()’ at test/dbwrapper_tests.cpp:365:21:
18/usr/include/x86_64-linux-gnu/bits/stdio2.h:54:35: note: ‘__builtin___snprintf_chk’ output between 2 and 12 bytes into a destination of size 10
19 54 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
20 | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21 55 | __glibc_objsize (__s), __fmt,
22 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 56 | __va_arg_pack ());
24 | ~~~~~~~~~~~~~~~~~
(I ran with --enable-werror
, otherwise it’s merely a warning)
cc @achow101