I just compiled with a new g++ version for the first time, and noticed some warnings. I don’t know how serious these are. I don’t think they’re very bad (concerning deprecations mostly):
- “specified bound 12 equals destination size”
0In file included from /usr/include/string.h:494,
1 from ./serialize.h:20,
2 from ./netaddress.h:13,
3 from ./protocol.h:13,
4 from protocol.cpp:6:
5In function ‘char* strncpy(char*, const char*, size_t)’,
6 inlined from ‘CMessageHeader::CMessageHeader(const unsigned char (&)[4], const char*, unsigned int)’ at protocol.cpp:91:12:
7/usr/include/bits/string_fortified.h:106:34: warning: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ specified bound 12 equals destination size [-Wstringop-truncation]
8 106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
9 | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- implicitly-declared ‘PartiallySignedTransaction& PartiallySignedTransaction::operator=(const PartiallySignedTransaction&)’ is deprecated [-Wdeprecated-copy]
0psbt.cpp: In function ‘TransactionError CombinePSBTs(PartiallySignedTransaction&, const std::vector<PartiallySignedTransaction>&)’:
1psbt.cpp:335:19: warning: implicitly-declared ‘PartiallySignedTransaction& PartiallySignedTransaction::operator=(const PartiallySignedTransaction&)’ is deprecated [-Wdeprecated-copy]
2 335 | out = psbtxs[0]; // Copy the first one
3 | ^
4In file included from psbt.cpp:5:
5./psbt.h:398:5: note: because ‘PartiallySignedTransaction’ has user-provided ‘PartiallySignedTransaction::PartiallySignedTransaction(const PartiallySignedTransaction&)’
6 398 | PartiallySignedTransaction(const PartiallySignedTransaction& psbt_in) : tx(psbt_in.tx), inputs(psbt_in.inputs), outputs(psbt_in.outputs), unknown(psbt_in.unknown) {}
7 | ^~~~~~~~~~~~~~~~~~~~~~~~~~
- warning: redundant move in return statement
0interfaces/chain.cpp: In member function ‘virtual std::unique_ptr<interfaces::Chain::Lock> interfaces::{anonymous}::ChainImpl::lock(bool)’:
1interfaces/chain.cpp:249:25: warning: redundant move in return statement [-Wredundant-move]
2 249 | return std::move(result);
3 | ~~~~~~~~~^~~~~~~~
4interfaces/chain.cpp:249:25: note: remove ‘std::move’ call