aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/build-data/buildh.in16
-rw-r--r--src/build-data/cc/gcc.txt2
-rw-r--r--src/lib/utils/assert.h2
3 files changed, 18 insertions, 2 deletions
diff --git a/src/build-data/buildh.in b/src/build-data/buildh.in
index a1febe102..42d5a1531 100644
--- a/src/build-data/buildh.in
+++ b/src/build-data/buildh.in
@@ -245,6 +245,22 @@ softare-based entropy polling is still used.
#endif
+#if !defined(BOTAN_NORETURN)
+
+ #if defined (__clang__) || defined (__GNUG__)
+ #define BOTAN_NORETURN __attribute__ ((__noreturn__))
+
+ #elif defined (_MSC_VER)
+ #define BOTAN_NORETURN __declspec(noreturn)
+
+ #else
+ #define BOTAN_NORETURN
+
+ #endif
+
+#endif
+
+
#if defined(_MSC_VER)
#define BOTAN_CURRENT_FUNCTION __FUNCTION__
#else
diff --git a/src/build-data/cc/gcc.txt b/src/build-data/cc/gcc.txt
index c507b6f02..b00f8bd31 100644
--- a/src/build-data/cc/gcc.txt
+++ b/src/build-data/cc/gcc.txt
@@ -8,7 +8,7 @@ add_lib_dir_option -L
add_lib_option -l
lang_flags "-std=c++11 -D_REENTRANT"
-maintainer_warning_flags "-Wold-style-cast -Werror -Wno-error=old-style-cast -Wno-error=zero-as-null-pointer-constant -Wno-error=unused-parameter -Wno-error=unused-variable -Wno-error=strict-overflow -Wsuggest-override"
+maintainer_warning_flags "-Wold-style-cast -Werror -Wno-error=old-style-cast -Wno-error=zero-as-null-pointer-constant -Wno-error=unused-parameter -Wno-error=unused-variable -Wno-error=strict-overflow -Wsuggest-override -Wsuggest-attribute=noreturn"
warning_flags "-Wall -Wextra -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wzero-as-null-pointer-constant -Wnon-virtual-dtor"
compile_flags "-c"
diff --git a/src/lib/utils/assert.h b/src/lib/utils/assert.h
index 97924174e..f80f9b170 100644
--- a/src/lib/utils/assert.h
+++ b/src/lib/utils/assert.h
@@ -15,7 +15,7 @@ namespace Botan {
/**
* Called when an assertion fails
*/
-void BOTAN_DLL assertion_failure(const char* expr_str,
+BOTAN_NORETURN void BOTAN_DLL assertion_failure(const char* expr_str,
const char* assertion_made,
const char* func,
const char* file,