no_sanitize is Clang 3.7+
Change-Id: Ifa67c3e5cc188db71fab389f20f55e7cbfc6de8d
Reviewed-on: https://skia-review.googlesource.com/49747
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Yuqian Li <liyuqian@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
diff --git a/include/private/SkFloatingPoint.h b/include/private/SkFloatingPoint.h
index a131726..01afcd8 100644
--- a/include/private/SkFloatingPoint.h
+++ b/include/private/SkFloatingPoint.h
@@ -108,7 +108,7 @@
// Cast double to float, ignoring any warning about too-large finite values being cast to float.
// Clang thinks this is undefined, but it's actually implementation defined to return either
// the largest float or infinity (one of the two bracketing representable floats). Good enough!
-#if defined(__clang__)
+#if defined(__clang__) && (__clang_major__ * 1000 + __clang_minor__) >= 3007
__attribute__((no_sanitize("float-cast-overflow")))
#endif
static inline float sk_double_to_float(double x) {