Skip to content

Commit e98bcfb

Browse files
r-barnesfacebook-github-bot
authored andcommitted
Fix unused-return in folly/debugging/symbolizer/DwarfUtil.cpp +4
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: D77424526 fbshipit-source-id: b21cc6d31e70344cb2b21dea194d6685327adecf
1 parent 1e2a086 commit e98bcfb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

third-party/folly/src/folly/debugging/symbolizer/DwarfUtil.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,6 @@ Attribute readAttribute(
761761
FOLLY_SAFE_DFATAL("invalid attribute form: ", spec.form);
762762
return {spec, die, 0u};
763763
}
764-
return {spec, die, 0u};
765764
}
766765

767766
/*

third-party/folly/src/folly/debugging/symbolizer/detail/Debug.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ static r_debug* r_debug_cache_;
7878
struct r_debug* get_r_debug() {
7979
#if FOLLY_DETAIL_HAS_R_DEBUG
8080
return r_debug_cache_;
81-
#endif
81+
#else
8282
return nullptr;
83+
#endif
8384
}
8485

8586
} // namespace detail

0 commit comments

Comments
 (0)