Skip to content

Commit 64e2e10

Browse files
authored
Merge pull request ClickHouse#39318 from ClickHouse/fix_build_clang_13
Fix build clang-13
2 parents 855ad30 + 00e5bdb commit 64e2e10

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

base/base/defines.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,20 @@
9393
# define NO_SANITIZE_ADDRESS __attribute__((__no_sanitize__("address")))
9494
# define NO_SANITIZE_THREAD __attribute__((__no_sanitize__("thread")))
9595
# define ALWAYS_INLINE_NO_SANITIZE_UNDEFINED __attribute__((__always_inline__, __no_sanitize__("undefined")))
96-
# define DISABLE_SANITIZER_INSTRUMENTATION __attribute__((disable_sanitizer_instrumentation))
9796
#else /// It does not work in GCC. GCC 7 cannot recognize this attribute and GCC 8 simply ignores it.
9897
# define NO_SANITIZE_UNDEFINED
9998
# define NO_SANITIZE_ADDRESS
10099
# define NO_SANITIZE_THREAD
101100
# define ALWAYS_INLINE_NO_SANITIZE_UNDEFINED ALWAYS_INLINE
102101
#endif
103102

103+
#if defined(__clang__) && defined(__clang_major__) && __clang_major__ >= 14
104+
# define DISABLE_SANITIZER_INSTRUMENTATION __attribute__((disable_sanitizer_instrumentation))
105+
#else
106+
# define DISABLE_SANITIZER_INSTRUMENTATION
107+
#endif
108+
109+
104110
#if !__has_include(<sanitizer/asan_interface.h>) || !defined(ADDRESS_SANITIZER)
105111
# define ASAN_UNPOISON_MEMORY_REGION(a, b)
106112
# define ASAN_POISON_MEMORY_REGION(a, b)

0 commit comments

Comments
 (0)