Commit e37b0d4
Fix unreachable-break-or-return issue in proxygen/lib/http/codec/HTTPCodec.h +5
Summary:
LLVM has two warnings `-Wunreachable-code-return` and `-Wunreachable-code-break` which identify `return` and `break` statements that cannot be reached. These compromise readability, can be misleading, and may identify bugs. This diff removes such statements.
`break` was often used defensively in `switch` statements. We now have `-Wimplicit-fallthrough` [enabled globally](https://fb.workplace.com/groups/fbcode/posts/8021835991186503), which replaces this inexact practice with a compiler guarantee.
The compiler used to be less intelligent and would throw an error if a function didn't return the correct type after a `throw` statement. The compiler is smarter now, so this code is unnecessary. `-Wreturn-type` is enabled globally and prevents functions from ending without an appropriate return.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: dtolnay
Differential Revision: D79967259
fbshipit-source-id: 37b547b324af1db83599ccc78a927d4be77ec6f31 parent 1d94ca0 commit e37b0d4
File tree
5 files changed
+0
-7
lines changed- third-party/proxygen/src/proxygen/lib/http/codec
- compress
- experimental/simulator
- test
5 files changed
+0
-7
lines changedLines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
389 | | - | |
390 | 389 | | |
391 | 390 | | |
392 | 391 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
145 | 144 | | |
146 | 145 | | |
147 | 146 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
283 | 282 | | |
284 | 283 | | |
285 | 284 | | |
| |||
Lines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
905 | 905 | | |
906 | 906 | | |
907 | 907 | | |
908 | | - | |
909 | 908 | | |
910 | 909 | | |
911 | 910 | | |
| |||
982 | 981 | | |
983 | 982 | | |
984 | 983 | | |
985 | | - | |
986 | 984 | | |
987 | 985 | | |
988 | 986 | | |
| |||
1015 | 1013 | | |
1016 | 1014 | | |
1017 | 1015 | | |
1018 | | - | |
1019 | 1016 | | |
1020 | 1017 | | |
1021 | 1018 | | |
| |||
0 commit comments