[logging] LOG(FATAL) calls [[noreturn]] functions#11310
Merged
areusch merged 1 commit intoapache:mainfrom May 13, 2022
Merged
Conversation
Contributor
Author
|
CC: @areusch |
Contributor
Author
|
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
approved these changes
May 13, 2022
Contributor
tkonolige
left a comment
There was a problem hiding this comment.
Sounds like this will silence the llvm warnings that force us to put empty returns after LOG(FATAL). Thanks!
areusch
approved these changes
May 13, 2022
Contributor
Author
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. |
mehrdadh
pushed a commit
to mehrdadh/tvm
that referenced
this pull request
May 16, 2022
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.
shtinsa
pushed a commit
to Deelvin/tvm
that referenced
this pull request
May 17, 2022
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.
shingjan
pushed a commit
to shingjan/tvm
that referenced
this pull request
May 17, 2022
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.