diff options
author | MarcoFalke <falke.marco@gmail.com> | 2019-05-02 09:13:42 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2019-05-02 09:13:52 -0400 |
commit | c1ba1182eb4303e5ca0759068fed270685c6209f (patch) | |
tree | a5be2f4c2ac16b6b256504563efea7acff9e3fa8 | |
parent | c4560a7dfee94296e3fe7736423811c61356fbc5 (diff) | |
parent | beb42d71a0fd8ac75f3c889cb650b7d21fa9a740 (diff) |
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: https://github.com/bitcoin/bitcoin/commit/ef22fe8c1f331b4f13f21a54d12030b92e83fbe7#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
-rw-r--r-- | src/psbt.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/psbt.cpp b/src/psbt.cpp index f31f2af0d1..97bda51a63 100644 --- a/src/psbt.cpp +++ b/src/psbt.cpp @@ -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) |