summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/src/multiarray/common.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/common.h b/numpy/core/src/multiarray/common.h
index 85fd3aab1..ed022e4f8 100644
--- a/numpy/core/src/multiarray/common.h
+++ b/numpy/core/src/multiarray/common.h
@@ -248,6 +248,15 @@ npy_uint_alignment(int itemsize)
* compared to memchr it returns one stride past end instead of NULL if needle
* is not found.
*/
+#ifdef __clang__
+ /*
+ * The code below currently makes use of !NPY_ALIGNMENT_REQUIRED, which
+ * should be OK but causes the clang sanitizer to warn. It may make
+ * sense to modify the code to avoid this "unaligned" access but
+ * it would be good to carefully check the performance changes.
+ */
+ __attribute__((no_sanitize("alignment")))
+#endif
static NPY_INLINE char *
npy_memchr(char * haystack, char needle,
npy_intp stride, npy_intp size, npy_intp * psubloopsize, int invert)