Skip to content

Add -Wshadow to the C ratchet (#516) - #616

Merged
zackees merged 3 commits into
masterfrom
ci/516-wshadow
Oct 13, 2026
Merged

zackees merged 3 commits into
masterfrom
ci/516-wshadow

Conversation

@zackees

@zackees zackees commented Oct 13, 2026

Copy link
Copy Markdown
Member

Refs #516. C only; C++ shadow stays disabled.

RED: -Wno-shadow replaced by -Wshadow in the GCC C and Clang C options (GCC's shared list now keeps -Wno-shadow for CXX only); test/cmocka exempted (GCC/Clang only).
GREEN: 38 sites renamed (libobs, libobs-opengl, linux-capture, linux-pipewire, obs-outputs, vlc-video, happy-eyeballs, obs-scripting lua). Renames only; no public header or API change.

Exemptions (GCC/Clang only): test/cmocka, vendored librtmp, rnnoise.
Caveats: Xcode GCC_WARN_SHADOW is a single non-per-language setting, so left NO (macOS Xcode builds are not covered). Found with the full Linux build; QSV, NVENC, AJA, WebRTC and Windows/macOS-only C files were not compiled, only scanned heuristically (no hits).

Refs #516

Local-Gate: v1 tree=e52dbb36ed65b06dd0268b77e8dd4619beab2541 secs=367 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run
Ci-Attestation: {"at":1791922667,"gate":"rust/all/fmt","host":"linux-x86_64","key":"5d16232bff550d185f0cd8d386d210601c64f8f2dc28ac98972023d4be738f9c","lane":"lint","parents":["c9ab78930597165e583e8bd2c11795c58584480e"],"secs":19,"stamp":"42d76671af249717f7fb2e5a1cba7957","tree":"e52dbb36ed65b06dd0268b77e8dd4619beab2541","v":1,"via":"run"}
Ci-Attestation: {"at":1791922667,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"5d16232bff550d185f0cd8d386d210601c64f8f2dc28ac98972023d4be738f9c","lane":"lint","parents":["c9ab78930597165e583e8bd2c11795c58584480e"],"secs":19,"stamp":"2c7e481bbf629c614d87fe9b8e065976","tree":"e52dbb36ed65b06dd0268b77e8dd4619beab2541","v":1,"via":"run"}
Ci-Attestation: {"at":1791922667,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"3e12509f3b5e6ec497aa5f62fb0ddfc1b136cb67c7352a2458541f9bb147d961","lane":"rust-test","parents":["c9ab78930597165e583e8bd2c11795c58584480e"],"secs":135,"stamp":"0351d9a73bb290d9c6170d6a90fef3f4","tree":"e52dbb36ed65b06dd0268b77e8dd4619beab2541","v":1,"via":"run"}
Ci-Attestation: {"at":1791922667,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"d5eb6c15df59fec2093fb684a65d0f05f957e1d433ee5f904d9cf92ba917e667","lane":"cross","parents":["c9ab78930597165e583e8bd2c11795c58584480e"],"secs":66,"stamp":"53715583882cb462afb28e3c4834124d","tree":"e52dbb36ed65b06dd0268b77e8dd4619beab2541","v":1,"via":"run"}
Ci-Attestation: {"at":1791922667,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"d5eb6c15df59fec2093fb684a65d0f05f957e1d433ee5f904d9cf92ba917e667","lane":"cross","parents":["c9ab78930597165e583e8bd2c11795c58584480e"],"secs":66,"stamp":"1715ddcc7f3e34e83486c9f388df787c","tree":"e52dbb36ed65b06dd0268b77e8dd4619beab2541","v":1,"via":"run"}
Ci-Attestation: {"at":1791922667,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"d5eb6c15df59fec2093fb684a65d0f05f957e1d433ee5f904d9cf92ba917e667","lane":"cross","parents":["c9ab78930597165e583e8bd2c11795c58584480e"],"secs":66,"stamp":"fe92d03f5f6145a89e3adfc0adffd8bb","tree":"e52dbb36ed65b06dd0268b77e8dd4619beab2541","v":1,"via":"run"}
Ci-Attestation: {"at":1791922667,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"d5eb6c15df59fec2093fb684a65d0f05f957e1d433ee5f904d9cf92ba917e667","lane":"cross","parents":["c9ab78930597165e583e8bd2c11795c58584480e"],"secs":66,"stamp":"1ddb87461d0c8ef479f2cfa18df84491","tree":"e52dbb36ed65b06dd0268b77e8dd4619beab2541","v":1,"via":"run"}
Ci-Attestation: {"at":1791922667,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"d5eb6c15df59fec2093fb684a65d0f05f957e1d433ee5f904d9cf92ba917e667","lane":"cross","parents":["c9ab78930597165e583e8bd2c11795c58584480e"],"secs":66,"stamp":"02520052c792e843673d0ec9ef82bb29","tree":"e52dbb36ed65b06dd0268b77e8dd4619beab2541","v":1,"via":"run"}
Ci-Attestation: {"at":1791922667,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"d5eb6c15df59fec2093fb684a65d0f05f957e1d433ee5f904d9cf92ba917e667","lane":"cross","parents":["c9ab78930597165e583e8bd2c11795c58584480e"],"secs":66,"stamp":"8d8cd7d7b1d30bd2896a81f007ad7e60","tree":"e52dbb36ed65b06dd0268b77e8dd4619beab2541","v":1,"via":"run"}
Ci-Attestation: {"at":1791922667,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"138db114dae578ee7c957cbebeca9b6c60723bdffe3b20c85df13fabc3bc4f63","lane":"tier2-linux","parents":["c9ab78930597165e583e8bd2c11795c58584480e"],"secs":147,"stamp":"06d196c112d5e80be2de29ecc64c454c","tree":"e52dbb36ed65b06dd0268b77e8dd4619beab2541","v":1,"via":"run"}
@zackees zackees added the ci-full Run every CI job on this PR, including the release-gating OBS app builds and Flatpak label Oct 13, 2026
obs-audio.c: push_audio_tree and the mix loop's unlock still named the
outer source (uninitialized there; MSVC C4700, Clang -Wuninitialized).
rtmp-stream.c: the video loop released the outer settings instead of the
encoder's. GCC accepted both because the outer variable exists.

Refs #516

Local-Gate: v1 tree=05f95190f8981ca8ba32122ae6f952de36f35c14 secs=373 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run
Ci-Attestation: {"at":1791923879,"gate":"rust/all/fmt","host":"linux-x86_64","key":"cd0eb447105bc39b39c1185be6064ade1e2942fa2d026b69b9fc25e05e10c50f","lane":"lint","parents":["08098331cd25495673b80cb6d8eaca3d72c595b8"],"secs":30,"stamp":"d653ae71ef3294cc42b4359a4efd2cf5","tree":"05f95190f8981ca8ba32122ae6f952de36f35c14","v":1,"via":"run"}
Ci-Attestation: {"at":1791923879,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"cd0eb447105bc39b39c1185be6064ade1e2942fa2d026b69b9fc25e05e10c50f","lane":"lint","parents":["08098331cd25495673b80cb6d8eaca3d72c595b8"],"secs":30,"stamp":"64bdaefbcb2fb39c7efb02ec59b3cc0f","tree":"05f95190f8981ca8ba32122ae6f952de36f35c14","v":1,"via":"run"}
Ci-Attestation: {"at":1791923879,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"e2f1f3c834ce970b4cef51f59fd33190622ded26dc62baa4fe0f74a1c54b6d7e","lane":"rust-test","parents":["08098331cd25495673b80cb6d8eaca3d72c595b8"],"secs":119,"stamp":"079ffab48ff5fbe506ad64d060fc4c69","tree":"05f95190f8981ca8ba32122ae6f952de36f35c14","v":1,"via":"run"}
Ci-Attestation: {"at":1791923879,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"2091ef391551ea781621936d3be19efd604b5b02f0f1af0f74ef109faac85320","lane":"cross","parents":["08098331cd25495673b80cb6d8eaca3d72c595b8"],"secs":97,"stamp":"4759765f6771ca5b4608422d21e2bc1b","tree":"05f95190f8981ca8ba32122ae6f952de36f35c14","v":1,"via":"run"}
Ci-Attestation: {"at":1791923879,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"2091ef391551ea781621936d3be19efd604b5b02f0f1af0f74ef109faac85320","lane":"cross","parents":["08098331cd25495673b80cb6d8eaca3d72c595b8"],"secs":97,"stamp":"3797af5d9cdef9dc0986db5ed0c3af4d","tree":"05f95190f8981ca8ba32122ae6f952de36f35c14","v":1,"via":"run"}
Ci-Attestation: {"at":1791923879,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"2091ef391551ea781621936d3be19efd604b5b02f0f1af0f74ef109faac85320","lane":"cross","parents":["08098331cd25495673b80cb6d8eaca3d72c595b8"],"secs":97,"stamp":"576e8d56ca286f760d9e7c351c69a92a","tree":"05f95190f8981ca8ba32122ae6f952de36f35c14","v":1,"via":"run"}
Ci-Attestation: {"at":1791923879,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"2091ef391551ea781621936d3be19efd604b5b02f0f1af0f74ef109faac85320","lane":"cross","parents":["08098331cd25495673b80cb6d8eaca3d72c595b8"],"secs":97,"stamp":"bb32277a136bf4ef81af569525b03b62","tree":"05f95190f8981ca8ba32122ae6f952de36f35c14","v":1,"via":"run"}
Ci-Attestation: {"at":1791923879,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"2091ef391551ea781621936d3be19efd604b5b02f0f1af0f74ef109faac85320","lane":"cross","parents":["08098331cd25495673b80cb6d8eaca3d72c595b8"],"secs":97,"stamp":"1afc90f7382a6318f02778b7ed083c74","tree":"05f95190f8981ca8ba32122ae6f952de36f35c14","v":1,"via":"run"}
Ci-Attestation: {"at":1791923879,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"2091ef391551ea781621936d3be19efd604b5b02f0f1af0f74ef109faac85320","lane":"cross","parents":["08098331cd25495673b80cb6d8eaca3d72c595b8"],"secs":97,"stamp":"28acae4a202d02cd287bf383e21a9be9","tree":"05f95190f8981ca8ba32122ae6f952de36f35c14","v":1,"via":"run"}
Ci-Attestation: {"at":1791923880,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"e798fa4fa22b8bbd108b9ef09d589cd844e35d5416e5a23228266d7e05f371a3","lane":"tier2-linux","parents":["08098331cd25495673b80cb6d8eaca3d72c595b8"],"secs":126,"stamp":"1a3773e27bc14702bb5d4172520f25fc","tree":"05f95190f8981ca8ba32122ae6f952de36f35c14","v":1,"via":"run"}
@zackees

zackees commented Oct 13, 2026

Copy link
Copy Markdown
Member Author

Fixed in e45a2b6: two renames left references to the outer variable. GCC accepted them because the outer one exists. MSVC (C4700) and Clang (-Wuninitialized) caught the first.

  • obs-audio.c: push_audio_tree(NULL, source, …) in the channel loop, and pthread_mutex_unlock(&source->…) in the mix loop, which would have unlocked the wrong mutex.
  • rtmp-stream.c: the video-encoder loop released the outer settings instead of enc_settings (one leak plus one over-release).
    I also checked every other renamed local and parameter in the diff for leftover old-name uses inside its scope and found none.

@zackees
zackees merged commit e93cad0 into master Oct 13, 2026
24 checks passed
@zackees
zackees deleted the ci/516-wshadow branch October 26, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-full Run every CI job on this PR, including the release-gating OBS app builds and Flatpak

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant