mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 20:03:34 -03:00
Merge #10843: Add attribute [[noreturn]] (C++11) to functions that will not return
b82c55a
Add attribute [[noreturn]] (C++11) to functions that will not return (practicalswift)
Pull request description:
Add attribute `[[noreturn]]` (C++11) to functions that will not return.
Rationale:
* Reduce the number of false positives/false negatives from static analyzers with regards to things such as unused or unreachable code
* Potentially enable additional compiler optimizations
Tree-SHA512: 899683fe8b2fcf19bd334352271d368b46b805be9d426aac1808335fd95732d6d7078d3296951b9879196f3f6e3ec0fdb7695d0afdc3fbe4dd78a2ca70e91ff7
This commit is contained in:
commit
2ab7c6300f
2 changed files with 6 additions and 6 deletions
|
@ -46,10 +46,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()
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue