Skip to content

build(frontend): the app does not compile with Qt 6.8 since properties-view passes -Wfloat-conversion to its consumers (#3067) #3164

Closed

Description

@vpacher

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:

  1. Make the conversion groups of properties-view PRIVATE (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.
  2. Convert the two call sites: .arg(static_cast<double>(num), ...), or make num a double (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

  1. added
    bug
    P2
    size:S
    on Oct 31, 2026
  2. zackees commented on Oct 31, 2026

    @zackees
    Member

    /ready

    Coordinator triage (from the report; I have not reproduced the build): the cause described matches #3096. The INTERFACE conversion options on properties-view are 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 in ci/test_frontend_conversion_optins.py that no linked INTERFACE target adds a group to obs-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.

  3. added
    ready
    on Oct 31, 2026
  4. zackees commented on Oct 31, 2026

    @zackees
    Member

    Claiming: #3164 (properties-view leaks its conversion groups into every consumer's TUs)

    1. RED: extend ci/test_frontend_conversion_optins.py with a repo-wide check that no
      target_compile_options(<t> INTERFACE ...) names a positive conversion group: CMake appends
      linked 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-conversion in the frontend under Qt 6.8). It fails on master today.
    2. GREEN: give shared/properties-view's unity TU its own OBJECT library
      (properties-view-code) that states the three groups PRIVATE, and let the INTERFACE target
      carry only the objects, headers and include dirs. The ratchet stays where the sources are
      (repo_ratcheted_dirs() still lists shared/properties-view, so the sanitizer lane still
      selects on it); the consumers stop receiving the groups, so the app target's global pins hold
      again. Also convert the two OBSBasicStats call sites (issue option 2) so the file is clean
      under Qt 6.8's arg(double) once the app does opt in.
    3. Verify: self-tests (uv run ci/local_gate.py --only self-test), a local rebuild of a consumer
      that links properties-view (decklink-output-ui objects) with the flag list checked, PR CI.
      One PR today.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2bugreadysize:S

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions