[Development] Change in qfloat16 ?

Ivan Solovev ivan.solovev at qt.io
Mon Jul 28 18:03:39 CEST 2025


Hi Axel,

I do not recall any recent changes to qfloat16.
However, note that its available constructors depend on the QFLOAT16_IS_NATIVE define
which can be different on different platforms and/or compilers.

Looks like you have a native float16 support locally, while the CI only compiles snippets
in the configuration that does not have a native float16 support, so the implicit
constructor from float is enabled.


------------------------------

Ivan


Confidential
________________________________________
From: Development <development-bounces at qt-project.org> on behalf of Axel Spoerl via Development <development at qt-project.org>
Sent: Monday, July 28, 2025 5:13 PM
To: Qt Development
Subject: [Development] Change in qfloat16 ?

Hi,

Has anything changed in the qfloat16 implementation recently?

With qtbase head at 0dc377283b024cc65d6e8cd2126066ecbe753bea and
../../dev/qtbase/configure  -developer-build -xcb -make tests

...and g++15.1.1 on openSuSE, I get this error:
/home/axel/QtGit/dev/qtbase/src/corelib/doc/snippets/code/src_corelib_serialization_qcborstream.cpp: In function ‘void writeDouble(QCborStreamWriter&, double)’:
/home/axel/QtGit/dev/qtbase/src/corelib/doc/snippets/code/src_corelib_serialization_qcborstream.cpp:164:24: error: conversion from ‘float’ to non-scalar type ‘qfloat16’ requested
 164 |         qfloat16 f16 = f;

This fixes the problem: https://codereview.qt-project.org/c/qt/qtbase/+/664024
But I wonder how this can have merged: https://codereview.qt-project.org/c/qt/qtbase/+/663662

Thanks,
Axel


Confidential


More information about the Development mailing list