Skip to content

build: Maximum C/C++ warning strictness with -Werror on every platform (cross-compiled with soldr) #516

Open
4 of 5 issues completed

Description

@zackees

Directive (maintainer): raise the C/C++ compiler settings to maximum strictness, warnings as errors, and fix every violation on every platform. Cross-compile from Linux with soldr (Linux → Windows, macOS). If soldr or setup-soldr can't handle a toolchain, fix it there and forward the versions here.

Scope

  1. Phase 1, the C the Rust workspace builds (cc crate): obs-c-oracle (libobs sources under oracle_* names, plus deps/w32-pthreads on Windows) and obs-util's SEH shim. Today this builds with cc's default -Wall -Wextra (/W4) and no -Werror, so violations scroll past in every CI log (for example the windows-gnu rust-test lane).
  2. Phase 2, the CMake build (libobs, plugins, frontend): it already uses -Werror with OBS's warning set. Measure the same strict set there next, and ratchet it per target in follow-up PRs.

Strict set (GCC/Clang)

-Wall -Wextra -Wpedantic -Wshadow -Wformat=2 -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wundef -Wvla -Wdouble-promotion -Wconversion -Wsign-conversion -Werror; MSVC/clang-cl: /W4 /WX. Vendored third-party code (deps/w32-pthreads, vendor/uthash) is compiled in its own cc::Build with warnings reported but not fatal, and listed as an exemption.

Measured today (strict set, -p obs-c-oracle -p obs-util)

Target Toolchain (soldr) Result
host Linux system gcc 392 unique warnings: 305 missing-prototypes, 44 sign-conversion, 14 cast-qual, 9 strict-prototypes, 9 pedantic, 6 conversion, 3 format-nonliteral
x86_64-unknown-linux-gnu (explicit target) soldr gcc 13.3, glibc 2.17 sysroot fails: uuid/uuid.h missing from soldr's sysroot (platform-nix.c)
x86_64-pc-windows-gnu soldr mingw-w64 gcc 15.3 builds; also %zu unknown to MinGW printf (-Wformat), cast-function-type, unused-parameter (w32-pthreads)
x86_64-pc-windows-msvc clang-cl + xwin fails: util/util_uint64.h(29) calls _udiv128 without <intrin.h>
aarch64-apple-darwin clang + macOS SDK 14.5 builds; 383 unique warnings
x86_64-apple-darwin clang + macOS SDK 14.5 fails: oracle/sse-shim redefines __m128 on a real x86 target

Plan

  1. RED: the rust-test lane builds the workspace tests (--no-run) for every target above with the strict set and -Werror. It fails today.
  2. Fix the three hard failures: <intrin.h> for _udiv128 under clang-cl; the SSE shim only on non-x86; the uuid header for soldr's glibc-2.17 toolchain (fix in soldr/setup-soldr, then bump the pinned versions here, or fall back to a host include if that can't land).
  3. Fix the warnings by kind, one commit per kind: prototypes (static or headers), (void) prototypes, sign/conversion casts at the call sites that need them, const correctness, MinGW printf (__USE_MINGW_ANSI_STDIO or PRIx), and so on. Upstream libobs files change only where the fix is behavior-neutral.
  4. GREEN: every target builds with -Werror, and the CI lanes (rust-test on Linux, rust-cross-lint) enforce it.

Activity

  1. zackees commented on Oct 13, 2026

    @zackees
    MemberAuthor

    Claiming: #516. Order: (1) the three hard failures (clang-cl _udiv128, the x86 SSE shim, the uuid header for soldr's glibc-2.17 toolchain); (2) the strict -Werror set plus per-target --no-run lane checks (RED); (3) fixes by warning kind; (4) Phase 2, the CMake build.

  2. added
    claimedAn agent or person has claimed this; check the claim comment before starting
    on Oct 13, 2026
  3. 111 remaining items

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

    P2Normal prioritytrackerTracks work in sub-issues or a checklist; not claimable itself

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions