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>
This commit is contained in:
Mike Klein 2017-09-21 13:56:05 -04:00 committed by Skia Commit-Bot
parent 1e3b79e0c6
commit 5e996b85db

View File

@ -108,7 +108,7 @@ static inline int sk_float_saturate2int(float x) {
// 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) {