mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-03 09:56:38 -05:00
Add attribute [[noreturn]] (C++11) to functions that will not return
Rationale: * Reduce the number of false positives from static analyzers * Potentially enable additional compiler optimizations
This commit is contained in:
parent
5cfdda2503
commit
b82c55af78
2 changed files with 6 additions and 6 deletions
|
@ -39,10 +39,10 @@
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
#include <openssl/rand.h>
|
#include <openssl/rand.h>
|
||||||
|
|
||||||
static void RandFailure()
|
[[noreturn]] static void RandFailure()
|
||||||
{
|
{
|
||||||
LogPrintf("Failed to read randomness, aborting\n");
|
LogPrintf("Failed to read randomness, aborting\n");
|
||||||
abort();
|
std::abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int64_t GetPerformanceCounter()
|
static inline int64_t GetPerformanceCounter()
|
||||||
|
|
|
@ -10,14 +10,14 @@
|
||||||
|
|
||||||
std::unique_ptr<CConnman> g_connman;
|
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()
|
bool ShutdownRequested()
|
||||||
|
|
Loading…
Add table
Reference in a new issue