Skip to content
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

Add [[noreturn]] for some functions #3865

Merged
merged 2 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stl/src/cthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace {
_EXTERN_C

// TRANSITION, ABI: _Thrd_exit() is preserved for binary compatibility
_CRTIMP2_PURE void _Thrd_exit(int res) { // terminate execution of calling thread
[[noreturn]] _CRTIMP2_PURE void _Thrd_exit(int res) { // terminate execution of calling thread
_endthreadex(res);
}

Expand Down
2 changes: 1 addition & 1 deletion stl/src/mutex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include "primitives.hpp"

extern "C" _CRTIMP2_PURE void _Thrd_abort(const char* msg) { // abort on precondition failure
extern "C" [[noreturn]] _CRTIMP2_PURE void _Thrd_abort(const char* msg) { // abort on precondition failure
fputs(msg, stderr);
fputc('\n', stderr);
abort();
Expand Down
2 changes: 1 addition & 1 deletion stl/src/ppltasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ extern "C" NTSYSAPI _Success_(return != 0) WORD NTAPI
namespace Concurrency {

namespace details {
_CRTIMP2 void __cdecl _ReportUnobservedException() {
[[noreturn]] _CRTIMP2 void __cdecl _ReportUnobservedException() {

#if (defined(_M_IX86) || defined(_M_X64)) && !defined(_CRT_APP)
if (IsProcessorFeaturePresent(PF_FASTFAIL_AVAILABLE))
Expand Down