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 attribute [[noreturn]] (C++11) to functions that will not return #10843

Merged
merged 1 commit into from Aug 22, 2017
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/random.cpp
Expand Up @@ -39,10 +39,10 @@
#include <openssl/err.h>
#include <openssl/rand.h>

static void RandFailure()
[[noreturn]] static void RandFailure()
{
LogPrintf("Failed to read randomness, aborting\n");
abort();
std::abort();
}

static inline int64_t GetPerformanceCounter()
Expand Down
8 changes: 4 additions & 4 deletions src/test/test_bitcoin_main.cpp
Expand Up @@ -10,14 +10,14 @@

std::unique_ptr<CConnman> g_connman;

void Shutdown(void* parg)
[[noreturn]] void Shutdown(void* parg)
{
exit(EXIT_SUCCESS);
std::exit(EXIT_SUCCESS);
}

void StartShutdown()
[[noreturn]] void StartShutdown()
{
exit(EXIT_SUCCESS);
std::exit(EXIT_SUCCESS);
}

bool ShutdownRequested()
Expand Down