Merge #15938: refactor: Silence "control reaches end of non-void function" (-Wreturn-type) in psbt.cpp
beb42d71a0
Silence GCC 7 warning "control reaches end of non-void function" (-Wreturn-type) in psbt.cpp (practicalswift) Pull request description: Silence GCC 7 warning "control reaches end of non-void function" (`-Wreturn-type`) in `psbt.cpp`. Context:ef22fe8c1f (r33370109)
Before this patch: ``` $ ./configure CC=gcc-7 CXX=g++-7 $ make 2>&1 | grep -A2 "warning: " leveldb/util/logging.cc:58:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] (v == kMaxUint64/10 && delta > kMaxUint64%10)) { ~~~~~~^~~~~~~~~~~~~~~ -- leveldb/port/port_posix.cc:60:15: warning: ‘ecx’ may be used uninitialized in this function [-Wmaybe-uninitialized] return (ecx & (1 << 20)) != 0; ~~~~~^~~~~~~~~~~~ -- psbt.cpp:341:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ $ ``` After this patch: ``` $ ./configure CC=gcc-7 CXX=g++-7 $ make 2>&1 | grep -A2 "warning: " leveldb/util/logging.cc:58:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] (v == kMaxUint64/10 && delta > kMaxUint64%10)) { ~~~~~~^~~~~~~~~~~~~~~ -- leveldb/port/port_posix.cc:60:15: warning: ‘ecx’ may be used uninitialized in this function [-Wmaybe-uninitialized] return (ecx & (1 << 20)) != 0; ~~~~~^~~~~~~~~~~~ $ ``` ACKs for commit beb42d: Tree-SHA512: b068b9aef565cae0bd1fa1f79c8d422ed2c3e7645edfa14a780a36dd66095a3c627f4111a6b16e706ce6c8abafe51725af8b3bf60778821de0aa8f6193bfadf8
This commit is contained in:
commit
c1ba1182eb
1 changed files with 2 additions and 0 deletions
|
@ -337,7 +337,9 @@ std::string PSBTRoleName(PSBTRole role) {
|
|||
case PSBTRole::SIGNER: return "signer";
|
||||
case PSBTRole::FINALIZER: return "finalizer";
|
||||
case PSBTRole::EXTRACTOR: return "extractor";
|
||||
// no default case, so the compiler can warn about missing cases
|
||||
}
|
||||
assert(false);
|
||||
}
|
||||
|
||||
bool DecodeBase64PSBT(PartiallySignedTransaction& psbt, const std::string& base64_tx, std::string& error)
|
||||
|
|
Loading…
Reference in a new issue