Commit d5e5810
committed
Merge bitcoin/bitcoin#28999: build: Enable -Wunreachable-code
fa8adbe build: Enable -Wunreachable-code (MarcoFalke)
Pull request description:
It seems a bit confusing to write code after a `return`. This can even lead to bugs, or incorrect code, such as https://github.com/bitcoin/bitcoin/pull/28830/files#r1415372320 . (Edit: The linked instance is not found by clang's `-Wunreachable-code`).
Fix all issues by enabling `-Wunreachable-code`.
This flag also enables `-Wunreachable-code-loop-increment`, according to https://clang.llvm.org/docs/DiagnosticsReference.html#wunreachable-code, so remove that.
ACKs for top commit:
ajtowns:
> ACK [fa8adbe](bitcoin/bitcoin@fa8adbe)
stickies-v:
ACK fa8adbe
jonatack:
ACK fa8adbe tested with arm64 clang 17.0.6
Tree-SHA512: 12a2f74b69ae002e62ae08038f7458837090a12051a4c154d05ae4bb26fb19fc1fa76c63aedf2b3fbb36f048c593ca3b8c0efe03fe93cf07a0fd114fc84ce1e72 files changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
439 | | - | |
440 | 439 | | |
| 440 | + | |
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1499 | 1499 | | |
1500 | 1500 | | |
1501 | 1501 | | |
1502 | | - | |
| 1502 | + | |
1503 | 1503 | | |
1504 | 1504 | | |
1505 | 1505 | | |
| 1506 | + | |
1506 | 1507 | | |
1507 | 1508 | | |
1508 | 1509 | | |
1509 | 1510 | | |
1510 | | - | |
| 1511 | + | |
1511 | 1512 | | |
1512 | 1513 | | |
1513 | 1514 | | |
| 1515 | + | |
1514 | 1516 | | |
1515 | 1517 | | |
0 commit comments