Skip to content

Commit 3cb94cd

Browse files
committed
tests: Fix sanitizer version check on old Apple clang
See #669.
1 parent 2617138 commit 3cb94cd

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

libxml.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
#endif
5656

5757
#ifdef __clang__
58-
#if __clang_major__ >= 12
58+
#if (!defined(__apple_build_version__) && __clang_major__ >= 12) || \
59+
(defined(__apple_build_version__) && __clang_major__ >= 13)
5960
#define ATTRIBUTE_NO_SANITIZE_INTEGER \
6061
ATTRIBUTE_NO_SANITIZE("unsigned-integer-overflow") \
6162
ATTRIBUTE_NO_SANITIZE("unsigned-shift-base")

testdict.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include "libxml.h"
2+
13
#include <stdlib.h>
24
#include <string.h>
35
#include <libxml/parser.h>
@@ -6,19 +8,6 @@
68

79
/**** dictionary tests ****/
810

9-
#ifdef __clang__
10-
#if __clang_major__ >= 12
11-
#define ATTRIBUTE_NO_SANITIZE_INTEGER \
12-
__attribute__ ((no_sanitize("unsigned-integer-overflow"))) \
13-
__attribute__ ((no_sanitize("unsigned-shift-base")))
14-
#else
15-
#define ATTRIBUTE_NO_SANITIZE_INTEGER \
16-
__attribute__ ((no_sanitize("unsigned-integer-overflow")))
17-
#endif
18-
#else
19-
#define ATTRIBUTE_NO_SANITIZE_INTEGER
20-
#endif
21-
2211
/* #define WITH_PRINT */
2312

2413
static const char *seeds1[] = {

0 commit comments

Comments
 (0)