lib1587: fix gcc -Wconversion with LibreSSL on Windows, test in CI#22195
Closed
vszakats wants to merge 3 commits into
Closed
lib1587: fix gcc -Wconversion with LibreSSL on Windows, test in CI#22195vszakats wants to merge 3 commits into
-Wconversion with LibreSSL on Windows, test in CI#22195vszakats wants to merge 3 commits into
Conversation
vszakats
added a commit
to curl/curl-for-win
that referenced
this pull request
Jun 26, 2026
It could have happened when tests were expliticly enabled and building trurl as well. It also failed due to not building the curl tool, but the test target wanted to build tunits, which thus failed. With that fixed it would have still caused superfluous double work. Also rename internal option to reflect its purpose better. Refs: curl/curl#22195 (discovery) curl/curl#22198 (fallout fix)
vszakats
added a commit
that referenced
this pull request
Jun 26, 2026
It fails as expected, with a list of errors:
```
In file included from _x64-win-ucrt-for-trurl-bld/tests/tunit/tunits.c:5:
tests/tunit/tool1394.c:76:11: error: call to undeclared function 'parse_cert_parameter'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
76 | err = parse_cert_parameter(p->param, &certname, &passphrase);
| ^
[...]
tests/tunit/tool1622.c:68:5: error: call to undeclared function 'timebuf'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
68 | timebuf(buffer, sizeof(buffer), secs);
| ^
[...]
tests/tunit/tool1623.c:104:26: error: call to undeclared function 'GetSizeParameter'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
104 | ParameterError err = GetSizeParameter(check[i].input, &output);
| ^
[...]
```
Ref: https://github.com/curl/curl/actions/runs/28256499057/job/83720797064?pr=22195
Ref: #22195
Ref: curl/curl-for-win@640fed8
Closes #22198
lib1587.c use type from private openssl.h
curl-for-win.yml enable tests in the GCC job too
-Wconversion with LibreSSL on Windows-Wconversion with LibreSSL on Windows
-Wconversion with LibreSSL on Windows-Wconversion with LibreSSL on Windows, test in CI
There was a problem hiding this comment.
Pull request overview
This pull request fixes -Wconversion build failures in tests/libtest/lib1587.c when building against LibreSSL on Windows (gcc), by reusing a backend-specific option-type typedef from the OpenSSL vtls implementation. It also updates the curl-for-win GitHub Actions workflow to build curl’s tests in the Windows x64 gcc job to ensure this case is exercised in CI.
Changes:
- Introduce and expose
ctx_option_tinlib/vtls/openssl.h(with LibreSSL/BoringSSL/OpenSSL-family sizing) and reuse it from the test. - Remove the duplicate
ctx_option_ttypedef fromlib/vtls/openssl.c(now provided by the header). - Enable building curl tests in the
curl-for-winWindows x64 gcc CI job viaCW_CONFIG.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/libtest/lib1587.c | Switch test option variable to ctx_option_t to match LibreSSL’s option API types and avoid narrowing conversions. |
| lib/vtls/openssl.h | Define ctx_option_t in the shared OpenSSL backend header for reuse across translation units (including tests). |
| lib/vtls/openssl.c | Drop the now-duplicated local ctx_option_t typedef (uses the header’s definition). |
| .github/workflows/curl-for-win.yml | Enable curl test builds in the Windows x64 gcc job to cover the reported LibreSSL/gcc warning in CI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
By exposing and reusing existing custom type via
vtls/openss.h.Also:
Cost is 45s per job, so limit it to the gcc job.
Seen with Windows x64 gcc (not tested in CI prior to this patch):
Ref: https://github.com/curl/curl/actions/runs/28258372229/job/83727170184?pr=22195#step:3:4884
Ref: da2f05e #22198
Ref: 6163566 #22197
Follow-up to 3e40ccb #21290
Follow-up to 2db8ae4 #17809 #17801