aboutsummaryrefslogtreecommitdiffstats
path: root/src/build-data
diff options
context:
space:
mode:
authorDaniel Neus <[email protected]>2016-01-08 21:45:48 +0100
committerDaniel Neus <[email protected]>2016-01-08 21:45:48 +0100
commit401db82da42117744cede7ce1888d76f98072bcd (patch)
tree55c7c5d79152402afcebfeb927e61e8c9422a078 /src/build-data
parent805c391817f22681ca9f09d7b04475f7cd9d34e7 (diff)
add BOTAN_NORETURN macro and mark those functions that do not return with it
Diffstat (limited to 'src/build-data')
-rw-r--r--src/build-data/buildh.in16
-rw-r--r--src/build-data/cc/gcc.txt2
2 files changed, 17 insertions, 1 deletions
diff --git a/src/build-data/buildh.in b/src/build-data/buildh.in
index a1febe102..66696de00 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 79c9ba5f4..322f59453 100644
--- a/src/build-data/cc/gcc.txt
+++ b/src/build-data/cc/gcc.txt
@@ -9,7 +9,7 @@ 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"
-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"
+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 -Wsuggest-attribute=noreturn"
compile_flags "-c"
debug_info_flags "-g"