You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
build(cmake): Compile C with -Wpedantic (deps/glad exempt) #2623
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:-Wpedantic is in no CMake flag list — git grep Wpedantic -- cmake returns nothing. The Phase 2 C flags that did land are at cmake/linux/compilerconfig.cmake:69 (GCC C) and cmake/common/compiler_common.cmake:65-73 (clang C), with CMAKE_COMPILE_WARNING_AS_ERROR defaulting ON at compiler_common.cmake:94-95.
RED: add -Wpedantic to the C flag lists and build the Linux Tier 2 CMake tree; the first violation is the RED state.
Acceptance criteria:
The Linux and macOS CMake builds are clean with -Wpedantic in the C flag lists (both the GCC list and the clang list).
deps/glad is compiled without the flag, as an explicit target-level exemption rather than a global -Wno-pedantic; no first-party target is exempt.
The flag is still applied when CMAKE_COMPILE_WARNING_AS_ERROR is ON, so a new violation fails the build.
Claiming: add -Wpedantic to the CMake C flag lists (deps/glad target-exempt).
Plan (one PR):
Add -Wpedantic to the GNU and Clang C option lists (cmake/common/compiler_common.cmake, cmake/linux/compilerconfig.cmake), with deps/glad exempted at the target level (no global -Wno-pedantic, no first-party exemption).
RED: build the Linux Tier 2 libobs tree with the flag added; the first -Wpedantic finding is the RED state (record path:line).
GREEN: fix each finding at the source (explicit cast / widened type / the pedantic-correct form). No per-file -Wno-* and no #pragma, so a new violation still fails the build under CMAKE_COMPILE_WARNING_AS_ERROR=ON.
One PR on branch infra/2623-wpedantic, Refs #2623 and Refs #516.
Note on scope: accept criterion "Linux and macOS CMake builds clean" — this host can only build Linux; macOS is left to PR/release CI, so the PR will use Refs #2623, not Fixes.
RED (survey, OBS_EXTRA_CFLAGS='-Wpedantic', warnings-as-error off): 3110 warning
lines, of which ~200 first-party C (the rest vendored glad/libcaption/librtmp,
generated SWIG output and system headers) — dominated by object<->function
pointer conversions, __FUNCTION__, return with expression in a void
function, %p on non-void *, %m, pre-C23 empty braces, a forward enum
reference and __int128.
GREEN (Tier 2 Docker build stage, -Wpedantic on, warnings-as-error at its
default ON):
== configure + build (libobs and libobs-c-reference)
== libobs exported symbols, C vs Rust
IDENTICAL (1766 symbols)
RUN_DONE rc=0
Zero warning: lines. ./lint green, including ci/test_build_groups.py.
Scope notes: -Wpedantic is added to the C lists only (C++ untouched); vendored
targets are exempted at the target/per-source level (no global -Wno-pedantic,
no per-file -Wno-*, no #pragma), so a new first-party violation still fails
the build. macOS is unverifiable on this host, hence Refs rather than Fixes.
Closing as complete: #2643 (infra/2623-wpedantic) merged on 2026-10-27T15:48:00Z. The Tier 2 Docker build stage runs -Wpedantic on C lists only with warnings-as-error at its default ON and reports zero warning: lines; vendored targets are exempted per target/per source (no global or per-file -Wno-*, no pragmas). ./lint green including ci/test_build_groups.py. macOS remains unverified on this host, which is why the PR used Refs #2623 rather than Fixes; reopen if a macOS lane later reports a first-party pedantic violation.
Activity
zackees commentedon Oct 27, 2026
Claiming: add
-Wpedanticto the CMake C flag lists (deps/glad target-exempt).Plan (one PR):
-Wpedanticto the GNU and Clang C option lists (cmake/common/compiler_common.cmake,cmake/linux/compilerconfig.cmake), withdeps/gladexempted at the target level (no global-Wno-pedantic, no first-party exemption).-Wpedanticfinding is the RED state (recordpath:line).-Wno-*and no#pragma, so a new violation still fails the build underCMAKE_COMPILE_WARNING_AS_ERROR=ON.infra/2623-wpedantic,Refs #2623andRefs #516.Note on scope: accept criterion "Linux and macOS CMake builds clean" — this host can only build Linux; macOS is left to PR/release CI, so the PR will use
Refs #2623, notFixes.First PR expected within this tick.
fix(c): stop converting between object and function pointers (#2623)
fix(c): silence the remaining -Wpedantic findings (#2623)
zackees commentedon Oct 27, 2026
Done — PR #2643 (
infra/2623-wpedantic, 4 commits,Refs #2623+Refs #516).RED (survey,
OBS_EXTRA_CFLAGS='-Wpedantic', warnings-as-error off): 3110 warninglines, of which ~200 first-party C (the rest vendored glad/libcaption/librtmp,
generated SWIG output and system headers) — dominated by object<->function
pointer conversions,
__FUNCTION__,returnwith expression in avoidfunction,
%pon non-void *,%m, pre-C23 empty braces, a forwardenumreference and
__int128.GREEN (Tier 2 Docker build stage,
-Wpedanticon, warnings-as-error at itsdefault
ON):Zero
warning:lines../lintgreen, includingci/test_build_groups.py.Scope notes:
-Wpedanticis added to the C lists only (C++ untouched); vendoredtargets are exempted at the target/per-source level (no global
-Wno-pedantic,no per-file
-Wno-*, no#pragma), so a new first-party violation still failsthe build. macOS is unverifiable on this host, hence
Refsrather thanFixes.build(cmake): Compile C with -Wpedantic (#2623)
build(cmake): Exempt vendored glad/libcaption/librtmp from -Wpedantic (…
fix(c): stop converting between object and function pointers (#2623)
fix(c): silence the remaining -Wpedantic findings (#2623)
fix(test): exempt the cmocka tests from -Wpedantic (#2623)
fix(c): restore the early return in the key translators (#2623)
zackees commentedon Oct 28, 2026
Closing as complete: #2643 (
infra/2623-wpedantic) merged on 2026-10-27T15:48:00Z. The Tier 2 Docker build stage runs-Wpedanticon C lists only with warnings-as-error at its default ON and reports zerowarning:lines; vendored targets are exempted per target/per source (no global or per-file-Wno-*, no pragmas)../lintgreen includingci/test_build_groups.py. macOS remains unverified on this host, which is why the PR usedRefs #2623rather thanFixes; reopen if a macOS lane later reports a first-party pedantic violation.build(msvc): exempt the /W4 findings left in the vendored deps (#2626)
build(msvc): exempt the /W4 findings left in the vendored deps (#2626)
build(msvc): exempt the /W4 findings left in the vendored deps (#2626)
build(msvc): exempt the /W4 findings left in the vendored deps (#2626)
build(msvc): exempt the /W4 findings left in the vendored deps (#2626)
build(cmake): compile C with -Wpedantic (obs-rust#2623) (obs-rust#2643)
build(obs-scripting): Exempt the Lua SWIG sources from -Wpedantic (ob…
build(msvc): Compile C/C++ at /W4 and drop the dead /WX link option (o…