Skip to content

Declare every exported C function before its definition (-Wmissing-prototypes) - #570

Merged
zackees merged 2 commits into
masterfrom
ci/516-ratchet-missing-prototypes
Oct 13, 2026
Merged

zackees merged 2 commits into
masterfrom
ci/516-ratchet-missing-prototypes

Conversation

@zackees

@zackees zackees commented Oct 13, 2026

Copy link
Copy Markdown
Member

Part of #516: the last GCC/Clang ratchet rung.

  • RED: STRICT_FLAGS gains -Wmissing-prototypes (~340 sites).
  • GREEN:
    • Oracle test exports (~330, called from Rust over FFI): a prototype block in each rust/obs-c-oracle/oracle/*.c wrapper, next to the definitions. The cf_tokenizer LAYOUT/OFFSET macros emit one per generated function. The Windows-only and Apple-only host stand-ins are declared too.
    • libobs, made static (used only in their own file, not in any public header or Rust export list): os_process_pipe_create_internal (pipe-posix.c), matrix4_mul_4x3_only (matrix4.c), bitstream_reader_read_bit (bitstream.c).
    • libobs, in-file prototype (linked from elsewhere): base_default_log_handler/base_log_literal (Rust calls them), video_frame_get_linesizes/_plane_heights (not in video-frame.h), get_plugin_info (platform-nix.c, previously declared only by a local extern in obs-module.c).

STRICT_FLAGS now covers the whole GCC/Clang strict set from #516. All five targets build clean, the full workspace tests pass, and the local gate passed and is stamped. Still to come for #516: MSVC's extra /W4 warnings, and Phase 2 (the CMake build).

-Wmissing-prototypes:
- The oracle's test-only exports (about 330, called from Rust over FFI)
  get a prototype block in each oracle/*.c wrapper, next to their
  definitions; the cf_tokenizer LAYOUT/OFFSET macros emit one per
  generated function.
- libobs functions used only in their own file become static:
  os_process_pipe_create_internal (pipe-posix.c), matrix4_mul_4x3_only
  (matrix4.c), bitstream_reader_read_bit (bitstream.c). None is in a
  public header or a Rust export list.
- libobs functions linked from elsewhere get an in-file prototype:
  base_default_log_handler, base_log_literal (base-variadic.c, Rust
  calls them), video_frame_get_linesizes/plane_heights (video-frame.c,
  not in video-frame.h), get_plugin_info (platform-nix.c, declared only
  by a local extern in obs-module.c).

Refs #516

Local-Gate: v1 tree=50b8eddfdfdff1bdba199622776ba11f5db7a1b5 secs=469 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run
Ci-Attestation: {"at":1791899915,"gate":"rust/all/fmt","host":"linux-x86_64","key":"eb4eb59cc48c88c2e5579e655700041b7f8c1ccac27c6befbcf461dfd0dd44f0","lane":"lint","parents":["a0253b8257cabd73b2dbbcbf4dfbaf03d02beca9"],"secs":32,"stamp":"723aa83315ee6718d879d5f17bbb3e02","tree":"50b8eddfdfdff1bdba199622776ba11f5db7a1b5","v":1,"via":"run"}
Ci-Attestation: {"at":1791899915,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"eb4eb59cc48c88c2e5579e655700041b7f8c1ccac27c6befbcf461dfd0dd44f0","lane":"lint","parents":["a0253b8257cabd73b2dbbcbf4dfbaf03d02beca9"],"secs":32,"stamp":"61e6260e2c140c626dfbb53c27c4c5fa","tree":"50b8eddfdfdff1bdba199622776ba11f5db7a1b5","v":1,"via":"run"}
Ci-Attestation: {"at":1791899915,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"fc97ba8d71d08f3eb6ac3a67e43586d557baa795012483f50afa671fd78f85f5","lane":"rust-test","parents":["a0253b8257cabd73b2dbbcbf4dfbaf03d02beca9"],"secs":157,"stamp":"eca06e68ab33c41304159dbb4575cddb","tree":"50b8eddfdfdff1bdba199622776ba11f5db7a1b5","v":1,"via":"run"}
Ci-Attestation: {"at":1791899915,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"710957a6ffec816af38437a8f01e578ca04845485e4ed7c01395e6b13302274b","lane":"cross","parents":["a0253b8257cabd73b2dbbcbf4dfbaf03d02beca9"],"secs":175,"stamp":"70b28509f9c950cacf99f5e8c3ecd561","tree":"50b8eddfdfdff1bdba199622776ba11f5db7a1b5","v":1,"via":"run"}
Ci-Attestation: {"at":1791899915,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"710957a6ffec816af38437a8f01e578ca04845485e4ed7c01395e6b13302274b","lane":"cross","parents":["a0253b8257cabd73b2dbbcbf4dfbaf03d02beca9"],"secs":175,"stamp":"8779efa25aad1d00cd3c40d461db5716","tree":"50b8eddfdfdff1bdba199622776ba11f5db7a1b5","v":1,"via":"run"}
Ci-Attestation: {"at":1791899915,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"710957a6ffec816af38437a8f01e578ca04845485e4ed7c01395e6b13302274b","lane":"cross","parents":["a0253b8257cabd73b2dbbcbf4dfbaf03d02beca9"],"secs":175,"stamp":"58af60b6f0f6d29cf4d20cce7e41bbec","tree":"50b8eddfdfdff1bdba199622776ba11f5db7a1b5","v":1,"via":"run"}
Ci-Attestation: {"at":1791899915,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"710957a6ffec816af38437a8f01e578ca04845485e4ed7c01395e6b13302274b","lane":"cross","parents":["a0253b8257cabd73b2dbbcbf4dfbaf03d02beca9"],"secs":175,"stamp":"20d1ec8ccbbc76dc58e7ad3a4e38c7e3","tree":"50b8eddfdfdff1bdba199622776ba11f5db7a1b5","v":1,"via":"run"}
Ci-Attestation: {"at":1791899915,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"710957a6ffec816af38437a8f01e578ca04845485e4ed7c01395e6b13302274b","lane":"cross","parents":["a0253b8257cabd73b2dbbcbf4dfbaf03d02beca9"],"secs":175,"stamp":"1bd5280ba0b7e0caedf0ef21da844e60","tree":"50b8eddfdfdff1bdba199622776ba11f5db7a1b5","v":1,"via":"run"}
Ci-Attestation: {"at":1791899915,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"710957a6ffec816af38437a8f01e578ca04845485e4ed7c01395e6b13302274b","lane":"cross","parents":["a0253b8257cabd73b2dbbcbf4dfbaf03d02beca9"],"secs":175,"stamp":"a91251876a293545f448c239b197352b","tree":"50b8eddfdfdff1bdba199622776ba11f5db7a1b5","v":1,"via":"run"}
Ci-Attestation: {"at":1791899915,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"8e5218684df4bf5ef9328405de220981e820c8d8445be7ff07e1f408bd63ce14","lane":"tier2-linux","parents":["a0253b8257cabd73b2dbbcbf4dfbaf03d02beca9"],"secs":104,"stamp":"1cd31c8a4d2e027ab03c0499d55f137c","tree":"50b8eddfdfdff1bdba199622776ba11f5db7a1b5","v":1,"via":"run"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant