aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/build-data/cc/clang.txt2
-rw-r--r--src/cli/sandbox.cpp4
-rw-r--r--src/lib/utils/compiler.h15
3 files changed, 20 insertions, 1 deletions
diff --git a/src/build-data/cc/clang.txt b/src/build-data/cc/clang.txt
index 517ccf738..bc8a47a5a 100644
--- a/src/build-data/cc/clang.txt
+++ b/src/build-data/cc/clang.txt
@@ -6,7 +6,7 @@ lang_flags "-std=c++17 -D_REENTRANT"
warning_flags "-Wall -Wextra -Wpedantic -Wshadow -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wshorten-64-to-32"
-werror_flags "-Werror -Wno-error=unused-parameter -Wno-error=unreachable-code -Wno-error=unused-lambda-capture -Wno-error=deprecated-declarations"
+werror_flags "-Werror -Wno-error=unused-parameter -Wno-error=unreachable-code -Wno-error=unused-lambda-capture"
maintainer_warning_flags "-Wunreachable-code -Wdocumentation -Qunused-arguments"
diff --git a/src/cli/sandbox.cpp b/src/cli/sandbox.cpp
index 52f4a1943..eeabdc0ef 100644
--- a/src/cli/sandbox.cpp
+++ b/src/cli/sandbox.cpp
@@ -109,10 +109,14 @@ bool Sandbox::init()
return true;
#elif defined(BOTAN_TARGET_OS_HAS_SANDBOX_PROC)
+
+ BOTAN_DIAGNOSTIC_PUSH
+ BOTAN_DIAGNOSTIC_IGNORE_DEPRECATED
if (::sandbox_init(kSBXProfileNoWriteExceptTemporary, SANDBOX_NAMED, nullptr) < 0)
{
return false;
}
+ BOTAN_DIAGNOSTIC_POP
return true;
#else
diff --git a/src/lib/utils/compiler.h b/src/lib/utils/compiler.h
index a311b56e1..ef793b8de 100644
--- a/src/lib/utils/compiler.h
+++ b/src/lib/utils/compiler.h
@@ -145,4 +145,19 @@
#endif
+#if defined(BOTAN_BUILD_COMPILER_IS_GCC) || defined(BOTAN_BUILD_COMPILER_IS_CLANG)
+
+ #if defined(BOTAN_BUILD_COMPILER_IS_GCC)
+ #define BOTAN_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push")
+ #define BOTAN_DIAGNOSTIC_IGNORE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
+ #define BOTAN_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop")
+ #elif defined(BOTAN_BUILD_COMPILER_IS_CLANG)
+ #define BOTAN_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push")
+ #define BOTAN_DIAGNOSTIC_IGNORE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
+ #define BOTAN_DIAGNOSTIC_POP _Pragma("clang diagnostic pop")
+ #endif
+
+
+#endif
+
#endif