aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2019-06-29 08:37:24 -0400
committerJack Lloyd <[email protected]>2019-06-29 08:37:24 -0400
commit4a3b328ed7db9af24e9bbe20fa186a488669c28f (patch)
tree13977ead2d8d8889ec1abd9c76ac2d1fad743289
parent4b98864a3d87726dd0ced20d8e20cd3288697fd8 (diff)
Fix a warning when building under XLC
-rw-r--r--src/lib/utils/compiler.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/utils/compiler.h b/src/lib/utils/compiler.h
index abb2a79f0..8629435d9 100644
--- a/src/lib/utils/compiler.h
+++ b/src/lib/utils/compiler.h
@@ -83,7 +83,10 @@
/*
* Define BOTAN_MALLOC_FN
*/
-#if defined(__clang__) || (BOTAN_GCC_VERSION >= 500)
+#if defined(__ibmxl__)
+ // XLC pretends to be both Clang and GCC, but is neither
+ #define BOTAN_MALLOC_FN __attribute__ ((malloc))
+#elif defined(__clang__) || (BOTAN_GCC_VERSION >= 500)
#define BOTAN_MALLOC_FN __attribute__ ((malloc, returns_nonnull, alloc_size(1,2)))
#elif defined(__GNUG__)
#define BOTAN_MALLOC_FN __attribute__ ((malloc, alloc_size(1,2)))