Repository navigation
Open
4 / 54 of 5 issues completedOpen
build: Maximum C/C++ warning strictness with -Werror on every platform (cross-compiled with soldr)#516
4 / 54 of 5 issues completed
Copy link
Labels
P2Normal priorityNormal prioritytrackerTracks work in sub-issues or a checklist; not claimable itselfTracks work in sub-issues or a checklist; not claimable itself
Description
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
- Phase 1, the C the Rust workspace builds (
cccrate):obs-c-oracle(libobs sources underoracle_*names, plusdeps/w32-pthreadson Windows) andobs-util's SEH shim. Today this builds withcc's default-Wall -Wextra(/W4) and no-Werror, so violations scroll past in every CI log (for example the windows-gnurust-testlane). - Phase 2, the CMake build (libobs, plugins, frontend): it already uses
-Werrorwith 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
- RED: the
rust-testlane builds the workspace tests (--no-run) for every target above with the strict set and-Werror. It fails today. - Fix the three hard failures:
<intrin.h>for_udiv128under 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). - Fix the warnings by kind, one commit per kind: prototypes (
staticor headers),(void)prototypes, sign/conversion casts at the call sites that need them,constcorrectness, MinGW printf (__USE_MINGW_ANSI_STDIOorPRIx), and so on. Upstream libobs files change only where the fix is behavior-neutral. - GREEN: every target builds with
-Werror, and the CI lanes (rust-teston Linux,rust-cross-lint) enforce it.
Metadata
Metadata
Assignees
Labels
P2Normal priorityNormal prioritytrackerTracks work in sub-issues or a checklist; not claimable itselfTracks work in sub-issues or a checklist; not claimable itself
Type
Projects
- StatusShow more project fieldsBlocked
Activity
zackees commentedon Oct 13, 2026
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-Werrorset plus per-target--no-runlane checks (RED); (3) fixes by warning kind; (4) Phase 2, the CMake build.ci: Build the tests for Windows MSVC and both macOS targets in the cr…
Build the C oracle with clang-cl and for x86_64 macOS (GREEN)
release: promote a verified dry run's exact artifacts instead of rebu…
ci: Compile, not link, the cross targets' tests in the cross lane
feat(gnu-linux): layer managed libuuid onto the glibc 2.17 sysroot (#…
fix(darwin): select lld link-only through a clang config file (#3776)
libobs/util: Initialize next_seek_position (MSVC C4701)
fix(release): promotion requires only release-artifact smokes (#2469) (…
build: Make C warnings errors in the Rust workspace's C builds (RED)
Fix the C warnings the Werror build finds on Windows and macOS (GREEN)
build: Format the oracle build script
libobs/util: Initialize next_seek_position (MSVC C4701)
build: Disable MSVC C4702 in the oracle (uthash macros)
111 remaining items
build(msvc): exempt the C tests from the /W4-only classes (#2626)
build(msvc): clear the wave 4 /W4 findings in obs-outputs and the tests
build(msvc): exempt the /W4 findings left in the vendored deps (#2626)
build(msvc): name the hotkey and undo params at their declarations (#…
build(msvc): name the transition, studio-mode and projector locals (#…
build(msvc): lead HandleFindData with its over-aligned member (#2626)
build(c-oracle): Add -Wformat=2 and -Wconversion to STRICT_FLAGS (obs…
build(cmake): compile C with -Wpedantic (obs-rust#2623) (obs-rust#2643)
fix(media-io): Drop the double cast in db_to_mul that -Wconversion re…
build(obs-scripting): Exempt the SWIG Python runtime from -Wpedantic (o…
build(obs-scripting): Exempt the SWIG sources from -Wmissing-prototyp…
build(obs-scripting): Exempt the Lua SWIG sources from -Wpedantic (ob…
build(cmocka): compile the C tests with -Wno-comma (obs-rust#2842) (o…
build(msvc): Compile C/C++ at /W4 and drop the dead /WX link option (o…
fix(obs-scripting): make the six conversion narrowings explicit (obs-…