Skip to content

Commit ad5d0f4

Browse files
r-barnesfacebook-github-bot
authored andcommitted
Fix unused-return in proxygen/lib/http/codec/ErrorCode.cpp +2
Summary: LLVM has a warning `-Wunreachable-code-return` which identifies return statements that cannot be reached. In innocuous situations such statements are often present: * to satisfy a compiler warning that existed before `[[noreturn]]` was introduced. Now that we have `[[noreturn]]`, this use is not necessary. * to specify a return type. But there are clearer ways to do this. * in place of the more legible `__builtin_unreachable()` (which will soon become `std::unreachable()`). In this case, we should use the more legible alternative. * because the programmer was afraid of the function unexpectedly returning. But we check for this condition with `-Wreturn-type`. In dangerous situations such statements can obscure the intended execution of the program or even hide an erroneous early return. In this diff, we remove one or more unreachable returns. - If you approve of this diff, please use the "Accept & Ship" button :-) Differential Revision: D77424525 fbshipit-source-id: 41b3b0350e5de1ac7a4c9a3a06d5d2e3d9203f16
1 parent 1165dce commit ad5d0f4

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

third-party/proxygen/src/proxygen/lib/http/codec/ErrorCode.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ const char* getErrorCodeString(ErrorCode error) {
4646
return "MAX";
4747
}
4848
LOG(FATAL) << "Unreachable";
49-
return "";
5049
}
5150

5251
} // namespace proxygen

0 commit comments

Comments
 (0)