path: root/src
diff options
authorShawn Rutledge <>2017-11-17 10:35:58 +0100
committerLiang Qi <>2017-11-18 06:58:33 +0000
commita4113d0c644edba1c39d9d268a259e95ae51c61e (patch)
treea241a2ad03bd592943cfcd9bd27a438ec02531d2 /src
parentc4885b21d6d18364d931cb103bd5a7306748d9b8 (diff)
qfloat16(float) constructor: explicit cast on aarch64 to avoid warning
The warning was global/qfloat16.h: In constructor ‘qfloat16::qfloat16(float)’: global/qfloat16.h:124:18: error: conversion to ‘__fp16’ from ‘float’ may alter its value [-Werror=float-conversion] __fp16 f16 = f; ^ cc1plus: all warnings being treated as errors The warning was added by fb5976038162d93d60c7f76376bbb4df38e83ba9. Change-Id: I489348c4d5d672bfa5d4db99c837696a2a69a27e Reviewed-by: Thiago Macieira <>
Diffstat (limited to 'src')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h
index 10598adb1d..a36852fc22 100644
--- a/src/corelib/global/qfloat16.h
+++ b/src/corelib/global/qfloat16.h
@@ -121,7 +121,7 @@ inline qfloat16::qfloat16(float f) Q_DECL_NOTHROW
__m128i packhalf = _mm_cvtps_ph(packsingle, 0);
b16 = _mm_extract_epi16(packhalf, 0);
#elif defined (__ARM_FP16_FORMAT_IEEE)
- __fp16 f16 = f;
+ __fp16 f16 = __fp16(f);
memcpy(&b16, &f16, sizeof(quint16));
quint32 u;