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 <marc.mutz@kdab.com>
This commit is contained in:
Thiago Macieira 2017-04-01 18:37:36 -07:00
parent 8241d51f70
commit 392294936e

View File

@ -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<float>(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
{