Skip to content

build(c-oracle): Add -Wformat=2 and -Wconversion to STRICT_FLAGS #2622

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.

Location: rust/obs-c-oracle/build.rs:118-129 (STRICT_FLAGS), which the oracle build applies with warnings(true), extra_warnings(true), warnings_into_errors(true) (build.rs:353-362, -Wall -Wextra -Werror at :357).

Gap: STRICT_FLAGS has -Wformat-nonliteral but not -Wformat=2, and no -Wconversion. Those are the only two Phase 1 flags missing.

RED: add both flags to STRICT_FLAGS and run the oracle build; it fails on the first violation. That failure is the RED state.

Acceptance criteria:

  • soldr cargo test --workspace --no-run is clean for the host Linux target, x86_64-pc-windows-gnu, x86_64-pc-windows-msvc, aarch64-apple-darwin and x86_64-apple-darwin. CI compiles every oracle translation unit for the cross targets (ci/local_gate.py:665-673), so PR CI covers all five.
  • The vendored deps/w32-pthreads build keeps its existing exemption; no new exemption is added for a first-party file.
  • Both flags stay in STRICT_FLAGS with no -Wno-* set beside them.

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

Activity

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

    @zackees
    MemberAuthor

    Claiming: c-oracle STRICT_FLAGS gains -Wformat=2 and -Wconversion (#2622, part of #516).

    Plan (one PR, one unit):

    1. Add -Wformat=2 and -Wconversion to STRICT_FLAGS in rust/obs-c-oracle/build.rs (host + cross targets; the MSVC branch is untouched).
    2. RED: the oracle build fails on the first violation under the new flags — record the host failure.
    3. GREEN: fix what the two flags find (per-file #pragma GCC diagnostic ignored only where an upstream/vendored construct is deliberate, as the existing -Wconversion pragmas in oracle/gif*.c, lzw.c already do), until the host build is clean; PR CI covers the five cross targets via ci/local_gate.py.
    4. Keep both flags with no -Wno-* beside them, and add no exemption for a first-party file.

    First PR within the hour.

  3. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Unit complete: PR #2632 adds -Wformat=2 and -Wconversion to the oracle's STRICT_FLAGS and fixes the 37 -Wconversion findings at 30 sites over 9 first-party libobs/ files with explicit casts (values unchanged).

    • RED b522192da: flags added, oracle build fails on libobs/util/serializer.h:91 (int → uint8_t).
    • GREEN 1bb55c4f7: the casts; soldr cargo build -p obs-c-oracle clean, soldr cargo test -p obs-c-oracle --no-run clean, clang-format --dry-run --Werror clean on the nine files.
    • No -Wno-*, no #pragma, no first-party exemption; both flags stay in STRICT_FLAGS. Host Linux verified locally; the five cross targets are covered by PR CI's ci/local_gate.py lane.

    Auto-merge is on. Note: the work is larger than size:S (30 sites / 9 files), and overlaps #2625's conversion-pin drop, which will touch the same libobs/ sources.

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

Metadata

Metadata

Assignees

Labels

P2infrareadysize:S

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions