Repository navigation
Conversation
zlib.h declares a free_func typedef, and wolfssl/internal.h and wolfio.h include zlib.h when HAVE_LIBZ is defined. The WOLFSSL_CRYPTO_EX_free* parameter of the *_get_ex_new_index() functions was also named free_func, which shadows that typedef in a --with-libz build. Rename the parameter to free_cb in the declarations, definitions and the English and Japanese Doxygen docs. No functional change.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are identified for the callback-parameter rename intended to avoid zlib typedef shadowing.
No open issues 🎉
What changed in this PR
Renames ex_data free-callback parameters from free_func to free_cb to avoid shadowing zlib’s typedef in libz-enabled builds. Function signatures and runtime behavior remain unchanged.
Changes:
- Updates parameter names and references in public/internal declarations and implementations.
- Aligns English and Japanese Doxygen documentation with the renamed parameter.
| File | Description |
|---|---|
wolfssl/ssl.h |
Renames callback parameters in public declarations. |
wolfssl/internal.h |
Updates the internal index-helper declaration. |
src/x509.c |
Updates the X509 wrapper parameter and forwarding call. |
src/ssl.c |
Renames parameters and uses in callback helpers and index APIs. |
src/ssl_sess.c |
Updates the session wrapper parameter and forwarding call. |
doc/dox_comments/header_files/ssl.h |
Aligns English documentation and its declaration. |
doc/dox_comments/header_files-ja/ssl.h |
Aligns Japanese documentation and its declaration. |
Review effort: Balanced
|
Contributor
Author
|
Jenkins: retest this please |
Contributor
|
not reproducing shadowed variable when testing on Fedora linux. nit: instead of rename, just prefix all with |
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.
Description
zlib.h declares a free_func typedef, and wolfssl/internal.h and wolfio.h include zlib.h when HAVE_LIBZ is defined. The WOLFSSL_CRYPTO_EX_free* parameter of the *_get_ex_new_index() functions was also named free_func, which shadows that typedef in a --with-libz build. Rename the parameter to free_cb in the declarations, definitions and the English and Japanese Doxygen docs. No functional change.
Testing
./configure --enable-all --with-libz=/path/to/zlib