Skip to content

ci: Add a compile the public headers job (#1387)#1870

Open
kallal79 wants to merge 3 commits into
bitcoin-core:masterfrom
kallal79:fix-issue-1387
Open

ci: Add a compile the public headers job (#1387)#1870
kallal79 wants to merge 3 commits into
bitcoin-core:masterfrom
kallal79:fix-issue-1387

Conversation

@kallal79

Copy link
Copy Markdown
Contributor

This PR ensures that all public C headers in secp256k1 are strictly self-contained and independently compilable without requiring downstream projects to manually include missing dependencies (like <stddef.h> or <stdint.h>).

Changes included:

  1. GitHub Actions (ci.yml): Added a dedicated c_headers_debian job that runs gcc and clang in -std=c89 and -pedantic-errors modes to precompile every public header, mirroring the existing C++ checks. Also updated the Windows MSVC job to test headers using -TC (C-mode).
  2. Offline Tests (test_public_headers.c): Created a dedicated C test file that explicitly #includes every public header conditionally based on enabled modules (e.g., ENABLE_MODULE_ECDH). This test is fully integrated into both CMakeLists.txt and Makefile.am so it will automatically be verified during local make check and ctest runs.

@real-or-random

Copy link
Copy Markdown
Contributor

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants