From 392294936ed14ee75b3d1cdae559bd41bbf63ef2 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 1 Apr 2017 18:37:36 -0700 Subject: qfloat16: suppress warning caused by Clang macro we used Clang implements the _cvtss_sh intrinsic by way of a macro, which uses a C99 extension and that's not allowed in C++ mode: float16.h:119:11: error: compound literals are a C99-specific feature [-Werror,-Wc99-extensions] /usr/bin/../lib64/clang/3.9.1/include/f16cintrin.h:76:55: note: expanded from macro '_cvtss_sh' Reported at https://bugs.llvm.org/show_bug.cgi?id=32491. Change-Id: I27b55fdf514247549455fffd14b170df75dd4e1f Reviewed-by: Marc Mutz --- src/corelib/global/qfloat16.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h index 651057f8e2..0fa83db93f 100644 --- a/src/corelib/global/qfloat16.h +++ b/src/corelib/global/qfloat16.h @@ -113,6 +113,8 @@ inline Q_REQUIRED_RESULT bool qIsNull(qfloat16 f) Q_DECL_NOTHROW inline int qIntCast(qfloat16 f) Q_DECL_NOTHROW { return int(static_cast(f)); } +QT_WARNING_PUSH +QT_WARNING_DISABLE_CLANG("-Wc99-extensions") inline qfloat16::qfloat16(float f) Q_DECL_NOTHROW { #if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__F16C__) @@ -127,6 +129,7 @@ inline qfloat16::qfloat16(float f) Q_DECL_NOTHROW + ((u & 0x007fffff) >> shifttable[(u >> 23) & 0x1ff]); #endif } +QT_WARNING_POP inline qfloat16::operator float() const Q_DECL_NOTHROW { -- cgit v1.2.3