Skip to content

build(msvc): Raise /W3 to /W4 and delete the dead /WX link option #2626

Closed

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 MSVC CMake build is still /W3 (cmake/windows/compilerconfig.cmake:68). /WX is not missing: CMAKE_COMPILE_WARNING_AS_ERROR is on through compiler_common.cmake:94-95, so CMake already passes /WX to cl.exe. The warning level alone is the gap. Separately, cmake/windows/compilerconfig.cmake:101-102 adds /WX to add_link_options, where link.exe ignores it — dead, and removing it changes no compile result.

RED: change /W3 to /W4 and build the windows-msvc target; the first new warning is the RED state.

Acceptance criteria:

  • The windows-msvc CMake build is clean at /W4, with /WX still in effect for cl.exe through CMAKE_COMPILE_WARNING_AS_ERROR.
  • The dead /WX in add_link_options (compilerconfig.cmake:101-102) is deleted; nothing replaces it, because the compile-time setting already covers the intent.
  • Any warning that only /W4 reports is fixed, not disabled with #pragma warning(disable:) or a per-file /wd.
  • The cross-compiled x86_64-pc-windows-msvc oracle build (ci/local_gate.py:665-673) is still clean.

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

Activity

  1. added
    infraBuild, gate, CI and tooling
    readyMeets the definition of Ready; claimable
    P2Normal priority
    on Oct 27, 2026
  2. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Claiming: build(msvc) /W3 -> /W4 and delete the dead /WX link option

    Plan, one PR from fix/2626-msvc-w4:

    1. RED: flip /W3 to /W4 in cmake/windows/compilerconfig.cmake and pin the
      invariant with a ci/test_*.py that reads the CMake file (MSVC C/CXX warning
      level is /W4, /WX comes only from CMAKE_COMPILE_WARNING_AS_ERROR, no
      /WX in add_link_options), so the RED is a failing offline test plus the
      /W4 survey of the Windows lane.
    2. Survey the /W4 findings from the Windows lane log (full log file, not
      --log-failed) and group them by warning code; the oracle half is already
      proven clean at /W4 /WX by rust/obs-c-oracle/build.rs, so the delta is
      frontend C++ / plugins.
    3. GREEN: fix every /W4-only finding at the site (no #pragma warning(disable:),
      no per-file /wd), delete the dead /WX in add_link_options
      (compilerconfig.cmake:101-102).
    4. Re-run the cross x86_64-pc-windows-msvc oracle build (ci/local_gate.py
      cross lane) and push. PR CI Windows lanes are the merge gate; no
      docs/features.md line (build tooling only).

    First PR: today.

  3. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Progress: PR #2691 (draft) has the /W4 flip + the dead /WX link option removal + a pin, and the vendored deps/libcaption / deps/w32-pthreads exemptions are green on the Windows Tier 2 lane (their C4244 / C4324 / C4057 / C4310 / C4456 / C4701-4703 findings are cleared).

    Remaining, all first-party libobs Windows C — enumerated in the PR comment with file:line, code and intended fix:

    • wasapi-output.c.h:429 C4189 (dead local)
    • obs-win-crash-handler.c.h:114-124 C4152 (function/data pointer macro)
    • obs-windows.c.h:1119-1120, 1322-1327 C4152
    • util/windows/window-helpers.c.h:73 C4457 (shadowed parameter)

    The MSVC build stops at the first warning per TU, so more are expected behind these. Continuing on the next worker tick; the PR stays draft until the Windows lanes are green.

  4. 292 remaining items

  5. zackees commented on Oct 29, 2026

    @zackees
    MemberAuthor

    Progress: the /W4 burn-down is complete in #2691.

    Build windows x64 🧱 and Build windows arm64 🧱 plus both Release gate 🚦 / Windows 🪟 jobs are green on head 779351559 (verify-only dispatch 40812008399): the Qt frontend, the full plugin set and the product C++ headers compile at /W4 under /WX with no warning left. PR CI is green and the PR is queued to merge.

    The two vendored trees from the earlier scope question are exempt per target, without editing their sources: plugins/obs-outputs keeps librtmp at per-source /wd4244;/wd4245;/wd4456;/wd4702;/wd4706 and deps/libdshowcapture extends its INTERFACE /wd4005 /wd4018 with /wd4244;/wd4456;/wd4458. No product target carries a blanket /wd.

    The issue still has human-review-needed from that escalation; the automation cannot clear it, so it needs a maintainer's label edit (or a Decided: comment) before the issue closes.

  6. zackees commented on Oct 29, 2026

    @zackees
    MemberAuthor

    Merged: #2691 landed as 4e6fee33 (squash), so the MSVC lanes now compile the whole app tree at /W4 and the dead /WX link option is gone.

    Evidence on the final head (779351559, wave 28):

    • Windows app build x64/arm64 green: run 40812008399 (jobs 123246922885, 123246923015), including the packaged-launch smoke jobs.
    • PR CI green incl. CI Gate ✅, Fast Gate, Rust Tier 2 Linux/macOS/Windows, cross-compile, Format.
    • Merge-group run for pr-2691 40815038521: success, so master carries the change.

    The 28-wave loop fixed each finding at its declaration; the only exemptions are the pre-existing third-party librtmp source set (/wd4244;/wd4245;/wd4456;/wd4702;/wd4706 beside its clang -Wno-* list), documented in plugins/obs-outputs/CMakeLists.txt. No first-party source uses #pragma warning(disable:).

    Closing this as delivered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Normal priorityinfraBuild, gate, CI and toolingreadyMeets the definition of Ready; claimablesize:MAbout a day

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions