-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[logging] LOG(FATAL) calls [[noreturn]] functions #11310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
CC: @areusch |
|
Note: one motivation for this PR is to support #11245. |
Ensure that `LOG(FATAL)` always resolves to calling `[[noreturn]]` code. This has two benefits: - Helps developers more quickly understand the intended/required behavior for `LOG(FATAL)` calls. - May eliminate spurious compiler warnings based on control-flow analysis. E.g. gcc's / clang's `-Wno-return` warnings.
777d231 to
6074e6e
Compare
tkonolige
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like this will silence the llvm warnings that force us to put empty returns after LOG(FATAL). Thanks!
That was my intent, but I'm not sure it's actually effective, at least with the gcc / clang builds I tried. Hopefully newer/future versions of those compilers will be smarter about this. |
Ensure that `LOG(FATAL)` always resolves to calling `[[noreturn]]` code. This has two benefits: - Helps developers more quickly understand the intended/required behavior for `LOG(FATAL)` calls. - May eliminate spurious compiler warnings based on control-flow analysis. E.g. gcc's / clang's `-Wno-return` warnings.
Ensure that `LOG(FATAL)` always resolves to calling `[[noreturn]]` code. This has two benefits: - Helps developers more quickly understand the intended/required behavior for `LOG(FATAL)` calls. - May eliminate spurious compiler warnings based on control-flow analysis. E.g. gcc's / clang's `-Wno-return` warnings.
Ensure that `LOG(FATAL)` always resolves to calling `[[noreturn]]` code. This has two benefits: - Helps developers more quickly understand the intended/required behavior for `LOG(FATAL)` calls. - May eliminate spurious compiler warnings based on control-flow analysis. E.g. gcc's / clang's `-Wno-return` warnings.
Ensure that
LOG(FATAL)always resolves to calling[[noreturn]]code. This has two benefits:Helps developers more quickly understand the
intended/required behavior for
LOG(FATAL)calls.May eliminate spurious compiler warnings
based on control-flow analysis. E.g. gcc's / clang's
-Wno-returnwarnings.