You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: obs-c-oracle: windows-gnu oracle build fails under -Wconversion in audio-math.h #2648
Since -Wconversion joined the C oracle's STRICT_FLAGS (#2632, closing #2622), the local gate's rust-test lane fails on master in its --no-run build of the tests for x86_64-pc-windows-gnu (the mingw-w64 cross toolchain soldr provides, GCC 15.3.0). The oracle's audio_controls.c stops at:
libobs/media-io/audio-math.h:38:25: error: conversion from 'double' to 'float' may change value [-Werror=float-conversion]
Where
libobs/media-io/audio-math.h:38, in db_to_mul():
returnisfinite((double)db) ? powf(10.0f, db / 20.0f) : 0.0f;
mingw-w64's isfinite() is a type-generic macro whose float branch casts its argument to float; that branch is never taken for a double, but GCC still checks it, so the (double) cast becomes a double-to-float conversion inside the macro. glibc's isfinite() uses a builtin, so the Linux build of the oracle is clean, and MSVC does not get the flag.
Class
Build break (warning promoted by -Werror), not a runtime bug. Only the windows-gnu cross build of the oracle sees it; Linux, macOS and MSVC builds are unaffected.
How it is reached
uv run ci/local_gate.py --lane rust-test (or ./unittest, or the local gate's stamp) on current master, on a host where soldr provides the mingw-w64 cross toolchain. Every PR's local gate stamp fails on it.
Proposed fix
Keep the C oracle's flags and fix the call without changing what it computes: test the float itself (isfinite(db)), which takes the macro's float branch, or, if the (double) was there for -Wdouble-promotion on another toolchain, suppress -Wfloat-conversion around the line for GCC on mingw only. Or, if the oracle should not compile this header with -Wconversion on windows-gnu yet, exempt that target in rust/obs-c-oracle/build.rs with a comment that names this issue.
Failing test
uv run ci/local_gate.py --lane rust-test fails today in the windows-gnu --no-run step; it passes once the header compiles under -Wconversion with mingw-w64 GCC 15.3.0.
Leave the public audio-math.h as it is, and turn off -Wfloat-conversion for the oracle on x86_64-pc-windows-gnu only, in rust/obs-c-oracle/build.rs, with a comment naming this issue. Linux GCC, clang and macOS keep the check.
RED is current master: soldr cargo build -p obs-c-oracle --target x86_64-pc-windows-gnu stops at audio-math.h:38:25 (-Werror=float-conversion). GREEN builds it clean, and the local gate's rust-test lane passes.
PR today, RED evidence and GREEN together (a build configuration fix).
Fixed by PR #2665, which merged through the merge queue (4cfe670).
The windows-gnu build of the C oracle (mingw-w64 GCC 15.3.0) no longer stops in db_to_mul() in audio-math.h: rust/obs-c-oracle/build.rs now adds -Wno-float-conversion for that target only, with a comment naming this issue. The public header is untouched, and the Linux GCC, clang and macOS oracle builds keep the full -Wconversion check. A new lint-lane test, ci/test_oracle_mingw.py, compiles the audio-math oracle source with the windows-gnu flags and fails without the change. The local gate's rust-test lane passes again.
Left: nothing. The flag is dropped for windows-gnu only, so a later change that wants -Wconversion clean on mingw can remove it. No follow-up issue was needed.
Activity
rdoupe commentedon Oct 27, 2026
Claiming: #2648.
audio-math.has it is, and turn off-Wfloat-conversionfor the oracle onx86_64-pc-windows-gnuonly, inrust/obs-c-oracle/build.rs, with a comment naming this issue. Linux GCC, clang and macOS keep the check.soldr cargo build -p obs-c-oracle --target x86_64-pc-windows-gnustops ataudio-math.h:38:25(-Werror=float-conversion). GREEN builds it clean, and the local gate'srust-testlane passes.rdoupe commentedon Oct 27, 2026
Fixed by PR #2665, which merged through the merge queue (4cfe670).
The windows-gnu build of the C oracle (mingw-w64 GCC 15.3.0) no longer stops in
db_to_mul()inaudio-math.h:rust/obs-c-oracle/build.rsnow adds-Wno-float-conversionfor that target only, with a comment naming this issue. The public header is untouched, and the Linux GCC, clang and macOS oracle builds keep the full-Wconversioncheck. A new lint-lane test,ci/test_oracle_mingw.py, compiles the audio-math oracle source with the windows-gnu flags and fails without the change. The local gate'srust-testlane passes again.Left: nothing. The flag is dropped for windows-gnu only, so a later change that wants
-Wconversionclean on mingw can remove it. No follow-up issue was needed.obs-c-oracle: Allow MinGW isfinite float casts (obs-rust#2665)