summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKevin Funk <kfunk@kde.org>2017-03-06 15:35:10 +0100
committerKevin Funk <kfunk@kde.org>2017-03-06 15:35:10 +0100
commit654d1bcd59f709cb0fa86a801f8056f198741421 (patch)
tree953521c9eee269b25cc218e4a843ebdde0d2ae95 /tests
parent03b8f632347cfdd8c30a2fc7f76bb6880221a7cf (diff)
downloadheaptrack-654d1bcd59f709cb0fa86a801f8056f198741421.tar.gz
heaptrack-654d1bcd59f709cb0fa86a801f8056f198741421.tar.bz2
heaptrack-654d1bcd59f709cb0fa86a801f8056f198741421.zip
Fix -Wexpansion-to-defined warning from Clang 3.9
Fixed: ``` /home/kfunk/devel/src/kf5/heaptrack/tests/manual/test.cpp:65:5: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined] #if HAVE_ALIGNED_ALLOC ^ /home/kfunk/devel/src/kf5/heaptrack/tests/manual/test.cpp:4:28: note: expanded from macro 'HAVE_ALIGNED_ALLOC' #define HAVE_ALIGNED_ALLOC defined(_ISOC11_SOURCE) ```
Diffstat (limited to 'tests')
-rw-r--r--tests/manual/test.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/manual/test.cpp b/tests/manual/test.cpp
index e3f1870..05d967c 100644
--- a/tests/manual/test.cpp
+++ b/tests/manual/test.cpp
@@ -1,7 +1,11 @@
#include <cstdio>
#include <cstdlib>
-#define HAVE_ALIGNED_ALLOC defined(_ISOC11_SOURCE)
+#if defined(_ISOC11_SOURCE)
+# define HAVE_ALIGNED_ALLOC 1
+#else
+# define HAVE_ALIGNED_ALLOC 0
+#endif
struct Foo
{