Repository navigation
fix(media-io): Drop the double cast in db_to_mul that -Wconversion rejects on MinGW (#516) - #2651
Merged
Merged
Conversation
…jects on MinGW (#516) #2632 added -Wconversion to the obs-c-oracle STRICT_FLAGS. MinGW's isfinite(x) expands to fpclassify(x), whose float arm calls __fpclassifyf(float) from a plain ternary, so passing (double)db type-checks as a double->float conversion and the windows-gnu cross build of the oracle fails under -Werror: libobs/media-io/audio-math.h:38:25: error: conversion from 'double' to 'float' may change value [-Werror=float-conversion] rust/obs-c-oracle/oracle/audio_controls.c (via libobs-ported-audio-controls.pch.h) db is already a const float, so the cast was redundant: isfinite(db) selects __fpclassifyf on MinGW, keeps the double arm on glibc/MSVC, and produces identical code on every compiler. Every other oracle translation unit for x86_64-pc-windows-gnu is clean under the same flag set (167/171 compile; the 4 remaining need build-script generated .inc files that are not part of the checkout).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
masteris red (run 40523654910, Fast Gate ⚡ →rust-test), ejected by #2632, which added-Wconversionto the obs-c-oracleSTRICT_FLAGS:Translation unit:
rust/obs-c-oracle/oracle/audio_controls.c←libobs/build/libobs-ported-audio-controls.pch.h←libobs/obs-audio-controls.c.h. Command:soldr cargo test --workspace --no-run --target x86_64-pc-windows-gnu.The site is only hit on
windows-gnu: MinGW-w64's<math.h>definesand
fpclassifypicks__fpclassifyf(float)from that ternary, so the argument(double)dbis type-checked as adouble→floatargument. glibc'sfpclassifyand MSVC'sisfinitedo not take that path, which is why the host and MSVC builds stay quiet.Fix
dbis alreadyconst float, so the cast was redundant:Semantically identical on every compiler: MinGW now selects
__fpclassifyf, glibc and MSVC still promote todouble. No behaviour change, no-Wno-*, no pragma.RED → GREEN
Replayed with the exact
ccline from the failed job's log (MinGWx86_64-w64-mingw32-gcc15.3.0 from the soldr syslib, same-Iset, same-Werror -Wall -Wextra -Wconversion …):origin/master's header:libobs/media-io/audio-math.h:38:25: error: conversion from 'double' to 'float' may change value [-Werror=float-conversion]— byte-for-byte the CI diagnostic.Swept the whole oracle for the same class of finding with that flag set (all 171 non-
_posix/ non-platform_windowsTUs):effect_parser_lifecycle.c,image_file.c,media_remux_adapter.c,obs_nvenc_loader.c) stop on#includeof build-script generated.incfiles (effect-parser-lifecycle.inc,obs-graphics-adapter.inc,media-remux-ffmpeg.inc,load_cuda_lib.inc) that only exist inOUT_DIR, so the local replay cannot reach their bodies. They are not warning failures.Also re-checked the header with host
gcc 15.2andclangunder-Wconversion -Wdouble-promotion -Werror: clean.No
docs/features.mdline: build-warning only, nothing user-visible.Refs #516 (strict-warning ratchet).