Repository navigation
build: Add -Wundef to the GCC and Clang C options - #595
Merged
Merged
Conversation
An undefined macro in #if evaluates to 0, which -Wundef reports. Platform macros use defined(); build options defined only when on (HAVE_UDEV, ENABLE_HEVC, ENABLE_FFMPEG_LOGGING) use #ifdef; the rest keep their value behind defined(). DEBUG_ASYNC_FRAMES defaults to 0 like DEBUG_AUDIO. Refs #516 Local-Gate: v1 tree=4c2bf1ab38519daf9b9365685827b7f1b52db772 secs=284 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run Ci-Attestation: {"at":1791906763,"gate":"rust/all/fmt","host":"linux-x86_64","key":"11b8e8d261c0f88a97a70ed1fa938ecbd9e9152834dee50077bb2aca2fc83c65","lane":"lint","parents":["103d467ff0b5a3e7cff0e0696678bfa595f10e97"],"secs":16,"stamp":"fc6b735e08aa03749d010dd13afb066d","tree":"4c2bf1ab38519daf9b9365685827b7f1b52db772","v":1,"via":"run"} Ci-Attestation: {"at":1791906763,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"11b8e8d261c0f88a97a70ed1fa938ecbd9e9152834dee50077bb2aca2fc83c65","lane":"lint","parents":["103d467ff0b5a3e7cff0e0696678bfa595f10e97"],"secs":16,"stamp":"d1c3ddb526fae5ff8c16e56b7e9be034","tree":"4c2bf1ab38519daf9b9365685827b7f1b52db772","v":1,"via":"run"} Ci-Attestation: {"at":1791906763,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"fd65307851e81c1abe84362f96580046f38df60df9b2fbf0472a30df70f957a2","lane":"rust-test","parents":["103d467ff0b5a3e7cff0e0696678bfa595f10e97"],"secs":82,"stamp":"ba943751fbd6d6479d587940b1ac7aee","tree":"4c2bf1ab38519daf9b9365685827b7f1b52db772","v":1,"via":"run"} Ci-Attestation: {"at":1791906763,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"ed6ca487742da4b00863a57a5423177e496e5ae5f45dc43f0e4ebdd149f2f905","lane":"cross","parents":["103d467ff0b5a3e7cff0e0696678bfa595f10e97"],"secs":67,"stamp":"ac966774b61f301b36c46f680ced31dc","tree":"4c2bf1ab38519daf9b9365685827b7f1b52db772","v":1,"via":"run"} Ci-Attestation: {"at":1791906763,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"ed6ca487742da4b00863a57a5423177e496e5ae5f45dc43f0e4ebdd149f2f905","lane":"cross","parents":["103d467ff0b5a3e7cff0e0696678bfa595f10e97"],"secs":67,"stamp":"5350fd58bb566c6548f370d54f5f4d01","tree":"4c2bf1ab38519daf9b9365685827b7f1b52db772","v":1,"via":"run"} Ci-Attestation: {"at":1791906763,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"ed6ca487742da4b00863a57a5423177e496e5ae5f45dc43f0e4ebdd149f2f905","lane":"cross","parents":["103d467ff0b5a3e7cff0e0696678bfa595f10e97"],"secs":67,"stamp":"d670b397a23900f256883fb46279d8ec","tree":"4c2bf1ab38519daf9b9365685827b7f1b52db772","v":1,"via":"run"} Ci-Attestation: {"at":1791906763,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"ed6ca487742da4b00863a57a5423177e496e5ae5f45dc43f0e4ebdd149f2f905","lane":"cross","parents":["103d467ff0b5a3e7cff0e0696678bfa595f10e97"],"secs":67,"stamp":"8c63ef2838d7798c5be52156ba7fc036","tree":"4c2bf1ab38519daf9b9365685827b7f1b52db772","v":1,"via":"run"} Ci-Attestation: {"at":1791906763,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"ed6ca487742da4b00863a57a5423177e496e5ae5f45dc43f0e4ebdd149f2f905","lane":"cross","parents":["103d467ff0b5a3e7cff0e0696678bfa595f10e97"],"secs":67,"stamp":"99e8b9ba66e387a22e30d5b6d3c30487","tree":"4c2bf1ab38519daf9b9365685827b7f1b52db772","v":1,"via":"run"} Ci-Attestation: {"at":1791906763,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"ed6ca487742da4b00863a57a5423177e496e5ae5f45dc43f0e4ebdd149f2f905","lane":"cross","parents":["103d467ff0b5a3e7cff0e0696678bfa595f10e97"],"secs":67,"stamp":"6136d0abfeec6049f2026d8855718994","tree":"4c2bf1ab38519daf9b9365685827b7f1b52db772","v":1,"via":"run"} Ci-Attestation: {"at":1791906763,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"9ae74927f8450e4027f14b4517b7bba8b91d91033bcb750853922f375f38c3f9","lane":"tier2-linux","parents":["103d467ff0b5a3e7cff0e0696678bfa595f10e97"],"secs":119,"stamp":"8f458916439ae245c3cddbd72016d3c4","tree":"4c2bf1ab38519daf9b9365685827b7f1b52db772","v":1,"via":"run"}
zackees
added a commit
that referenced
this pull request
Oct 13, 2026
Keep -Wundef (#595) next to -Wdouble-promotion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2 of #516: the first CMake-build ratchet.
-Wundefin the GCC (Linux) and Clang C options.#ifon a macro that can be undefined is fixed:defined();HAVE_UDEV,ENABLE_HEVC,ENABLE_FFMPEG_LOGGING) use#ifdef;defined();DEBUG_ASYNC_FRAMESdefaults to 0, likeDEBUG_AUDIO.SWIG-generated wrappers (obspython, obslua and the cmocka scripting tests) get
-Wno-undef.Tier 2 (Linux, warnings as errors,
ENABLE_RUST_LIBOBSOFF and ON) builds clean, and the local gate is stamped.ci-fullis set so the macOS, Windows and full Linux builds check the platform-specific sites.Refs #516