diff options
| author | Wladimir J. van der Laan <[email protected]> | 2020-06-04 16:25:54 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2020-06-04 16:27:53 +0200 |
| commit | b46fb5cb1058daaf0075b17f329163b8397caeec (patch) | |
| tree | 40ea674f8dab0d68e4c4b73ca37b8f9ed9540df1 /src/httpserver.cpp | |
| parent | Merge #19142: validation: Make VerifyDB level 4 interruptible (diff) | |
| parent | build: Enable unreachable-code-loop-increment (diff) | |
| download | discoin-b46fb5cb1058daaf0075b17f329163b8397caeec.tar.xz discoin-b46fb5cb1058daaf0075b17f329163b8397caeec.zip | |
Merge #19131: refactor: Fix unreachable code in init arg checks
eea81146571480b2acd12c8cd7f36b04d056c47f build: Enable unreachable-code-loop-increment (Jonathan Schoeller)
d15db4b1fc988736b08c092d000ca1d1ff686975 refactor: Fix unreachable code in init arg checks (Jonathan Schoeller)
Pull request description:
Closes: #19017
In #19015 it's been suggested that we add some new compiler warnings to our build. Some of these, such as `-Wunreachable-code-loop-increment`, generate warnings. We'll likely want to fix these up if we're going to turn these warnings on.
```shell
init.cpp:969:5: warning: loop will run at most once (loop increment never executed) [-Wunreachable-code-loop-increment]
for (const auto& arg : gArgs.GetUnsuitableSectionOnlyArgs()) {
^~~
1 warning generated.
```
https://github.com/bitcoin/bitcoin/blob/aa8d76806c74a51ec66e5004394fe9ea8ff0fac4/src/init.cpp#L968-L972
To fix this, collect all errors, and output them in a single error message after the loop completes. This resolves the unreachable code warning, and avoids popup hell that could result from outputting a seperate message for each error or warning one by one.
ACKs for top commit:
laanwj:
Code review ACK eea81146571480b2acd12c8cd7f36b04d056c47f
hebasto:
re-ACK eea81146571480b2acd12c8cd7f36b04d056c47f, only suggested changes applied since the [previous](https://github.com/bitcoin/bitcoin/pull/19131#pullrequestreview-421772387) review.
Tree-SHA512: 2aa3ceb7fab581b6ba2580900668388d8eba1c3001c8ff9c11c1f4a9a10fbc37f30e590249862676858446e3f4950140a252953ba1643ba3bfd772f8eae20583
Diffstat (limited to 'src/httpserver.cpp')
0 files changed, 0 insertions, 0 deletions