Skip to content

build(cmake): Drop the conversion pins (-Wno-conversion, -Wno-sign-conversion, -Wno-float-conversion) #2625

Open

Description

@zackees

Part of #516 (maximum C/C++ warning strictness). Split out because #516 is size:XL and the Definition of Ready splits an XL issue into sub-issues before it is claimed. The other four parts are linked from #516.

Gap: the conversion pins still hide the categories this issue names: -Wno-conversion at cmake/common/compiler_common.cmake:42 and cmake/linux/compilerconfig.cmake:46, -Wno-sign-conversion at compiler_common.cmake:53 and compilerconfig.cmake:51, -Wno-float-conversion at compiler_common.cmake:73.

This is the largest of the five: dropping the three pins surfaces every implicit conversion at the call sites, not one class of them. Re-measure first. The counts in #516's body (392 Phase 1, 3,160 Phase 2) are from 2026-10-13 and predate the ratchet PRs (#595 and later); they rank warning kinds, they are not a budget.

RED: drop the three pins and build the Linux Tier 2 CMake tree; the first implicit conversion is the RED state. If the volume is too large for one PR, land it as a series of per-directory PRs that each delete the pin only for their own files, with the last one deleting it from the flag list.

Acceptance criteria:

  • The Linux and macOS CMake builds are clean with none of -Wno-conversion, -Wno-sign-conversion, -Wno-float-conversion in any flag list.
  • Conversions are fixed at the call sites with an explicit cast or a widened type; no #pragma GCC diagnostic ignored and no per-file -Wno-* replaces the global pin.
  • The cast that fixes a conversion keeps the value it had: a narrowing cast is only used where the range is provably in bounds.
  • No regression in the -Werror behaviour: a new implicit conversion fails the build.

No docs/features.md line: build tooling only.

Activity

  1. added
    infra
    ready
    P2
    size:L
    on Oct 27, 2026
  2. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Claiming: #2625 — drop the three conversion pins (-Wno-conversion, -Wno-sign-conversion, -Wno-float-conversion) by fixing the conversions at the call sites.

    Plan (per the issue's own "re-measure first" instruction; one PR per directory group, the last one deleting the pin):

    1. Re-measure on current master, not from build: Maximum C/C++ warning strictness with -Werror on every platform (cross-compiled with soldr) #516's 2026-10-13 counts. The pins stay in place; the survey replays every C TU from the Tier 2 build volume's ninja -t compdb with the three -Wno-* dropped and -c swapped for -fsyntax-only, because zccache does not key on flags and a normal rebuild would report stale objects as clean.
    2. Group the findings by directory (libobs, libobs-opengl, plugins/*, shared/*) and post the table here before writing any fix, so the split into PRs is reviewable.
    3. RED/GREEN per slice: RED = the affected directory's TUs emitting the conversion warnings with the pins dropped; GREEN = the explicit casts/widened types, no #pragma GCC diagnostic ignored, no per-file -Wno-*, and the flag finally removed from compiler_common.cmake / compilerconfig.cmake only when the last slice lands.

    First PR: the measurement table plus the highest-density directory. No docs/features.md line (build tooling only).

  3. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Plan change before any code: the per-directory split in my claim above is withdrawn.

    It is expensive and it conflicts with this issue's own acceptance criteria — "per-directory PRs that each delete the pin only for their own files" means per-directory -Wno-*, which the same acceptance forbids, and a flag-list edit re-invalidates every TU, so a sliced series pays the invalidation N times and leaves the flag list half-deleted between landings. Measured cost of one slice PR (#2643, -Wpedantic): ~35 min for the successful Pull run on a 34m48s critical path plus a merge-queue re-run, with 3 more runs from iteration. This is the largest of the five children.

    Replacement, tracked in #2689 (P1): one PR for the whole conversion class, touching as many directories as the casts need, with the findings table grouped by directory in the PR body for review, -fsyntax-only replay of the affected TUs as the RED/inner loop, and the three pins removed in the same PR as the fixes. Step 1 of the claim stands unchanged: re-measure on current master and post the grouped table here before writing a fix.

  4. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Measurement done, and it changes the shape of this issue: the three pins are inert today.

    Nothing in either flag list enables -Wconversion, -Wsign-conversion or -Wfloat-conversion —
    the pins cancel warnings that are off by default, and -Wextra does not turn them on. Replaying the
    real Tier 2 compile commands for six libobs unity TUs, three ways:

    flags diagnostics
    master as configured (pins in place) 25
    the three pins deleted, nothing else 25
    pins deleted and the groups enabled 143

    So deleting the pins alone changes no build, and criterion 4 ("a new implicit conversion fails the
    build") only holds once the groups are enabled. The ratchet therefore has to be per target:
    enable the groups on the target, fix its sites
    , and delete the three pins from the global lists
    only in the last PR.

    Full survey with the groups enabled, -fsyntax-only over every C TU in the Tier 2 compdb (each TU's
    own zccache wrapper stripped; zccache does not key on flags, so a normal rebuild reports stale
    objects as clean):

    unique C TUs: 682, conversion diagnostics: 1599  (sign 1070, plain 519, float 10)
    
    area diagnostics note
    plugins/obs-outputs 480 196 of them librtmp/rtmp.c, vendored
    test 315 existing C tests — not editable
    libobs 210 35 of them libnsgif (vendored)
    plugins/obs-ffmpeg 125
    plugins/linux-v4l2 108
    libobs-opengl 90
    plugins/linux-capture 58
    plugins/linux-pipewire 44
    shared 38
    deps 32 vendored
    plugins/obs-nvenc 28
    plugins/obs-filters 22
    plugins/text-freetype2 17
    plugins/image-source 9
    plugins/linux-alsa 6 first slice, PR #2690
    plugins/obs-x264 6
    plugins/decklink 4
    plugins/linux-pulseaudio 4
    plugins/vlc-video 3

    159 distinct source files carry them; the largest single files are librtmp/rtmp.c 196,
    linux-capture/xcomposite-input.c.h 60, linux-v4l2/v4l2-input.c.h 55,
    linux-pipewire/pipewire.c.h 52, obs-outputs/rtmp-av1.c.h 49, obs-ffmpeg/obs-ffmpeg-srt.h 48,
    obs-outputs/rtmp-hevc.c.h 45, linux-capture/xshm-input.c.h 44.

    That is ~770 first-party sites once the vendored trees (librtmp, deps/, libnsgif) and the C
    tests are excluded, so it is a per-target series rather than one PR, in ascending size order,
    linux-alsa first.

    PR #2690 (branch infra/2625-conversion-alsa): RED 2ffe6b01d enables the three groups on the
    linux-alsa target only and fails with six diagnostics; GREEN 9e2e9188e fixes them at the call
    sites (settings rate narrowed to the plugin's unsigned rate, unsigned * unsigned sample_size,
    (int) for snd_pcm_recover's error code, and the post-frames <= 0 positive frame count widened).
    Local replay of that TU with the groups enabled: 6 -> 0 diagnostics, rc 0 with -Werror still on.

  5. moved this from Ready to In progress in obs-rust Multiviewon Oct 27, 2026
  6. zackees commented on Oct 28, 2026

    @zackees
    MemberAuthor

    Next slice: linux-pulseaudio — PR #2740 (infra/2625-conversion-pulseaudio), draft.

    RED 821a2c60f enables the three groups on the linux-pulseaudio target only and the replay of its 12 Tier 2 TUs reports four diagnostics in pulse-input.c.h (:200, :203, :327, :352, all uint_fast32_t/size_t to uint32_t). GREEN 14297b6ec makes those four conversions explicit and the same replay reports zero conversion diagnostics. The global pins stay until every target is ratcheted.

    Next targets after this one: plugins/vlc-video (3), plugins/decklink (4), plugins/obs-x264 (6).

  7. 420 remaining items

  8. zackees commented on Nov 6, 2026

    @zackees
    MemberAuthor

    Claiming: resume native DeckLink C++ slice in pool obs-studio3, PR #3787, following its release. 1. Commit RED regression for the GCC enum sentinel. 2. Confirm the plugin-internal header is not installed, name the existing -1 sentinel, audit consumers and compare optimized IR with master. 3. Replay all four native inputs with GCC and Clang without PCH/forced includes, validate, then ready and enqueue the pinned head this session. No warning suppression or default-path behavior change.

  9. zackees commented on Nov 6, 2026

    @zackees
    MemberAuthor

    Progress: resumed #3787 pushed and verified at 29b7509 (rebased prior 2818138 onto master fbd5aa5). New RED 223207c reproduces GNU enum conversion; GREEN names the existing -1 sentinel in the confirmed non-installed private header. All 4 native inputs pass BOTH GCC 15.2 and Clang 21.1.8 without PCH/forced include, including GCC audio-repack/SDK dispatch. All 6 supplementary mac cross replays pass. Three native optimized IR pairs identical; audio-repack differs only zext→sext and removal of GEP nuw, preserving every valid 0–7 index; PR explicitly documents this, not total identity. C/C++ probes confirm 4-byte unsigned int→int; consumers audited. 53 ratchet tests and independent clud-review pass. HOLD replaced with evidence; draft retained pending hosted CI. No suppressions or default-path/value change.

  10. zackees commented on Nov 6, 2026

    @zackees
    MemberAuthor

    Queued: native hand-written scripting #3786, position 1, pinned GREEN a6cd12a (RED 32c3965). All final-head hosted checks passed, including Format/Fast Gate and Linux Tier 2 OFF/ON plus serial suites. Four GCC/three Clang handwritten Python sites -> zero; all 50 ratchet tests and independent clud-review pass. All 12 optimized master/GREEN LLVM IR pairs byte-identical, hashes in PR. Generated SWIG runtime headers still fail inside handwritten groups, so the requested fallback is taken: no opt-in, suppression or classification change. Generated wrappers/runtime and global pins untouched. Actual scripting-input proof is local native Nix SWIG/LuaJIT GCC/Clang replay; hosted Fast Gate proves the extracted boundary regression, no hosted scripting build claimed. Full local lint exit 1 unknown because prescribed artifact continuation could not produce a complete safe report; hosted lint passed. Handing queue observation to pool manager per assignment; slot clean and detached at origin/master, no pruning. Broader #2625 remains open.

  11. zackees commented on Nov 7, 2026

    @zackees
    MemberAuthor

    Releasing resumed native DeckLink slice with draft #3787 at verified head 1aa1444. GNU sentinel resolution is complete: separate RED 445d8d2/GREEN 1aa1444, private non-installed enum -1 enumerator, valid modes unchanged; all 8 native GCC/Clang and 6 cross replays pass, 54 tests/review clean. IR differences are explicitly limited to audio-repack signed index extension; all other pairs identical. Hosted Format/Fast Gate passed. CI HOLD remains: ASan first attempt unrelated encoder failure #3788; the one policy-authorized retry passed it but failed existing slideshow assertion #3789. No further rerun or suppression. CI Gate red, draft/auto-merge OFF, not queued. Returning slot clean to detached origin/master; full evidence and response go to pool manager.

  12. moved this from In progress to Ready in obs-rust Multiviewon Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2infrareadysize:L

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions