Skip to content

Give the empty-PIN cache test hook C linkage - #259

Merged
Frauschi merged 1 commit into
wolfSSL:masterfrom
LinuxJedi:empty-pin-cache-test-c-linkage
Oct 19, 2026
Merged

Frauschi merged 1 commit into
wolfSSL:masterfrom
LinuxJedi:empty-pin-cache-test-c-linkage

Conversation

@LinuxJedi

Copy link
Copy Markdown
Member

tests/empty_pin_cache_test.c declares the debug-only hook WP11_Test_SetEmptyPinCheckHook without extern "C". The C++ debug CI job (cpp_debug_build, CC=g++ --enable-debug) compiles the tests as C++, so the test references a C++-mangled symbol and fails to link:

undefined reference to `WP11_Test_SetEmptyPinCheckHook(void (*)())'

This fails cpp_debug_build on master (e2a6548) and on every PR built on it. The declaration is now wrapped like the other test hook declarations (#256).

Testing:

  • Compiled as C++ with clang++ -x c++ against an --enable-debug build, the test failed to link before the change ("declaration possibly missing 'extern "C"'") and links after it.
  • The pre-commit hook make test passes (debug and default configs).

tests/empty_pin_cache_test.c declared WP11_Test_SetEmptyPinCheckHook
without extern "C", so the C++ debug build (cpp_debug_build) could not
link the test. Wrap it like the other test hook declarations.
Copilot AI balanced review requested due to automatic review settings October 19, 2026 12:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The narrow linkage fix matches the library declaration and has no identified issues.

No open issues 🎉

What changed in this PR

Fixes the empty-PIN cache test’s C++ debug-build link failure by matching the library hook’s C linkage.

Changes:

  • Wraps the hook declaration in an extern "C" guard, leaving C compilation and test behavior unchanged.
File Description
tests/​empty_pin_cache_test.c Adds conditional C linkage to the debug hook declaration.

Review effort: Balanced

Frauschi added a commit that referenced this pull request Oct 19, 2026
Write only changed token objects to storage.

Failing unit test is unrelated and fixed by #259.
@Frauschi
Frauschi merged commit f5c837a into wolfSSL:master Oct 19, 2026
97 checks passed
LinuxJedi added a commit that referenced this pull request Oct 21, 2026
* Set the version to 2.2.0 in configure.ac, CMakeLists.txt, the Doxyfiles
  and version.h, and add a Debian changelog entry.
* Bump the shared library version to 4.1.0, as the autotools build now
  exports the PKCS#11 v3.0 and v3.2 functions (PR #258).
* Add the 2.2 release notes to README.md, covering PR #203 through
  PR #259.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants