File tree Expand file tree Collapse file tree 3 files changed +7
-1
lines changed
Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 3131#include <stdlib.h>
3232
3333#include <CUnit/Basic.h>
34+ #define _TSK_WORKAROUND_FALSE_CLANG_WARNING
3435#include <tskit/trees.h>
3536
3637/* Global variables used in the test suite */
Original file line number Diff line number Diff line change @@ -39,9 +39,13 @@ extern "C" {
3939#include <stdint.h>
4040#include <limits.h>
4141
42- #if defined(__clang__ ) && ! defined(__cplusplus )
42+ #if defined(_TSK_WORKAROUND_FALSE_CLANG_WARNING ) && defined(__clang__ )
4343/* Work around bug in clang >= 6.0, https://github.com/tskit-dev/tskit/issues/721
4444 * (note: fixed in clang January 2019)
45+ * This workaround does some nasty fiddling with builtins and is only intended to
46+ * be used within the library. To turn it on, make sure
47+ * _TSK_WORKAROUND_FALSE_CLANG_WARNING is defined before including any tskit
48+ * headers.
4549 */
4650#if __has_builtin (__builtin_isnan )
4751#undef isnan
Original file line number Diff line number Diff line change 3232#include <float.h>
3333#include <math.h>
3434
35+ #define _TSK_WORKAROUND_FALSE_CLANG_WARNING
3536#include <tskit/tables.h>
3637
3738#define DEFAULT_SIZE_INCREMENT 1024
You can’t perform that action at this time.
0 commit comments