You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/12/02 20:39:32 UTC

[GitHub] [tvm] Lunderberg opened a new pull request, #13542: [Logging] Mark LogFatal::~LogFatal as [[noreturn]]

Lunderberg opened a new pull request, #13542:
URL: https://github.com/apache/tvm/pull/13542

   Using `LOG(FATAL) << "some error message";` throws an exception when the internal `LogFatal` object is constructed.  However, the gcc warning "control reaches end of non-void function" resulted in a common pattern where a `LOG(FATAL)` statement was immediately followed by return of a default value, in order to suppress the warning.
   
   This commit marks the `LogFatal::~LogFatal` destructor with the C++11 attribute `[[noreturn]]`, indicating that calls into it will not resume the normal control flow.  This suppresses the warning without requiring the extra `return` statement after `LOG(FATAL)`, as the compiler knows that control flow will not resume after `LOG(FATAL)`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] junrushao merged pull request #13542: [Logging] Mark LogFatal::~LogFatal as [[noreturn]]

Posted by GitBox <gi...@apache.org>.
junrushao merged PR #13542:
URL: https://github.com/apache/tvm/pull/13542


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] tvm-bot commented on pull request #13542: [Logging] Mark LogFatal::~LogFatal as [[noreturn]]

Posted by GitBox <gi...@apache.org>.
tvm-bot commented on PR #13542:
URL: https://github.com/apache/tvm/pull/13542#issuecomment-1335820469

   <!---bot-comment-->
   
   Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from [Reviewers](https://github.com/apache/incubator-tvm/blob/master/CONTRIBUTORS.md#reviewers) by @-ing them in a comment.
   
   <!--bot-comment-ccs-start-->
    * No users to tag found in teams: `logging`, `[noreturn` <sub>See [#10317](https://github.com/apache/tvm/issues/10317) for details</sub><!--bot-comment-ccs-end-->
   
   <sub>Generated by [tvm-bot](https://github.com/apache/tvm/blob/main/ci/README.md#github-actions)</sub>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] Lunderberg commented on pull request #13542: [Logging] Mark LogFatal::~LogFatal as [[noreturn]]

Posted by GitBox <gi...@apache.org>.
Lunderberg commented on PR #13542:
URL: https://github.com/apache/tvm/pull/13542#issuecomment-1335837688

   After conversation with @kparzysz-quic , it looks like whether `[[noreturn]]` was previously applied.  https://github.com/apache/tvm/pull/11310 also added `[[noreturn]]`, but only when the `TVM_LOG_CUSTOMIZE` macro is defined.  This PR applies `[[noreturn]]` to the other branch as well.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org