Skip to content

Commit

Permalink
Merge bitcoin#10843: Add attribute [[noreturn]] (C++11) to functions …
Browse files Browse the repository at this point in the history
…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
Signed-off-by: Pasta <pasta@dashboost.org>

# Conflicts:
#	src/test/test_bitcoin_main.cpp
  • Loading branch information
laanwj authored and PastaPastaPasta committed Nov 21, 2019
1 parent 6ff6f08 commit b354482
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/random.cpp
Expand Up @@ -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()
Expand Down

0 comments on commit b354482

Please sign in to comment.