Repository navigation
Description
What
On master 1b3a74fc4, a Linux build against the distribution Qt of Debian 13 (Qt 6.8.2, GCC 14.2.0) stops in the frontend app target:
frontend/widgets/OBSBasicStats.cpp.hpp:548:53: error: conversion from 'long double' to 'double' may change value [-Werror=float-conversion]
548 | megabytesSent->setText(QString("%1 %2").arg(num, 0, 'f', 1).arg(unit));
frontend/widgets/OBSBasicStats.cpp.hpp:556:47: error: conversion from 'long double' to 'double' may change value [-Werror=float-conversion]
556 | bitrate->setText(QString("%1 %2").arg(num, 0, 'f', 0).arg(unit));
These two lines are the only -Wfloat-conversion diagnostics in the full build (ENABLE_FRONTEND=ON, RelWithDebInfo, Ninja).
Cause
#3067 put properties-view on the conversion groups. On every platform except macOS, shared/properties-view/CMakeLists.txt adds them as INTERFACE options:
target_compile_options(
properties-view
INTERFACE "$<$<COMPILE_LANG_AND_ID:CXX,AppleClang,Clang,GNU>:-Wconversion;-Wsign-conversion;-Wfloat-conversion>"
)CMake appends linked INTERFACE options after the consumer's own options, so obs-studio gets -Wconversion -Wfloat-conversion after the global -Wno-conversion -Wno-float-conversion pins. frontend/CMakeLists.txt says the app target keeps those pins "until every frontend file is converted". This is the same mechanism #3096 fixed for the sign group on macOS.
OBSBasicStats.cpp.hpp passes a long double to QString::arg(). Qt 6.8 has only arg(double a, ...), so the call converts in our code, and -Wfloat-conversion reports it. Qt 6.11 (obs-deps) also has a template arg(T a, ...) for floating-point types that converts inside the Qt header, so no diagnostic reaches our code. The nightly Ubuntu app build (GCC 15.2) compiled this file without errors on 10-31, so CI stays green and only builds against an older Qt fail.
Proposed
One of:
- Make the conversion groups of
properties-viewPRIVATE (or PUBLIC only where a consumer has opted in), so they do not reach targets that still have the pins. This removes the whole class, also for the next consumer. - Convert the two call sites:
.arg(static_cast<double>(num), ...), or makenumadouble(the values are byte and kb/s counts shown with 0 or 1 decimals).
Option 2 alone fixes the build, but the frontend still gets the groups by way of the interface, ahead of the plan in frontend/CMakeLists.txt.
A test: a Linux build of the frontend against the oldest Qt the project supports, or a check in ci/test_frontend_conversion_optins.py that no linked INTERFACE target adds a conversion group to obs-studio before the app target opts in.
Workaround
-DCMAKE_CXX_FLAGS=-Wno-error=float-conversion (warning level only, no change to the generated code).
Activity
zackees commentedon Oct 31, 2026
/ready
Coordinator triage (from the report; I have not reproduced the build): the cause described matches #3096. The INTERFACE conversion options on
properties-vieware added after the frontend's-Wno-*pins. Option 1 is the preferred fix because it closes the whole class: make the groups PRIVATE, and add a ratchet check inci/test_frontend_conversion_optins.pythat no linked INTERFACE target adds a group toobs-studio. Option 2 can go in the same PR. Neither our CI nor the nightly builds against Qt 6.8, so the RED evidence is the ratchet test failing on current master. Labelled P2 (breaks distro-Qt builds while CI stays green), size:S. Thanks for the clear writeup, @vpacher.zackees commentedon Oct 31, 2026
Claiming: #3164 (properties-view leaks its conversion groups into every consumer's TUs)
ci/test_frontend_conversion_optins.pywith a repo-wide check that notarget_compile_options(<t> INTERFACE ...)names a positive conversion group: CMake appendslinked INTERFACE options after the consumer's own, so a consumer-side pin cannot win (build(frontend): macOS app lane still stops in Qt 6.11's headers after #2979's Darwin guard #3096,
and build(frontend): the app does not compile with Qt 6.8 since properties-view passes -Wfloat-conversion to its consumers (#3067) #3164's
-Wfloat-conversionin the frontend under Qt 6.8). It fails on master today.shared/properties-view's unity TU its ownOBJECTlibrary(
properties-view-code) that states the three groupsPRIVATE, and let the INTERFACE targetcarry only the objects, headers and include dirs. The ratchet stays where the sources are
(
repo_ratcheted_dirs()still listsshared/properties-view, so the sanitizer lane stillselects on it); the consumers stop receiving the groups, so the app target's global pins hold
again. Also convert the two
OBSBasicStatscall sites (issue option 2) so the file is cleanunder Qt 6.8's
arg(double)once the app does opt in.uv run ci/local_gate.py --only self-test), a local rebuild of a consumerthat links properties-view (decklink-output-ui objects) with the flag list checked, PR CI.
One PR today.
style: gersemi the properties-view CMakeLists (#3164)
test(ci): fail a linked INTERFACE target that states a conversion gro…
build(properties-view): state the conversion groups PRIVATE on the co…
style: gersemi the properties-view CMakeLists (#3164)
fix(build): forward properties-view-code's objects through the interf…
test(ci): fail a linked INTERFACE target that states a conversion gro…
build(properties-view): state the conversion groups PRIVATE on the co…
style: gersemi the properties-view CMakeLists (#3164)
fix(build): forward properties-view-code's objects through the interf…
build(properties-view): state the conversion groups PRIVATE on the co…