Skip to content

lib1587: fix gcc -Wconversion with LibreSSL on Windows, test in CI#22195

Closed
vszakats wants to merge 3 commits into
curl:masterfrom
vszakats:lib1587
Closed

lib1587: fix gcc -Wconversion with LibreSSL on Windows, test in CI#22195
vszakats wants to merge 3 commits into
curl:masterfrom
vszakats:lib1587

Conversation

@vszakats

@vszakats vszakats commented Jun 26, 2026

Copy link
Copy Markdown
Member

By exposing and reusing existing custom type via vtls/openss.h.

Also:

  • GHA/curl-for-win: test in CI by enabling building tests.
    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):

tests/libtest/lib1587.c:50:7: error: conversion from 'opt1587' {aka 'long long unsigned int'} to 'long int' may change value [-Werror=conversion]
   50 |       SSL_CTX_set_options(info->internals, opts);
      |       ^~~~~~~~~~~~~~~~~~~
tests/libtest/lib1587.c:59:7: error: conversion from 'opt1587' {aka 'long long unsigned int'} to 'long int' may change value [-Werror=conversion]
   59 |       SSL_set_options(info->internals, opts);
      |       ^~~~~~~~~~~~~~~

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

@github-actions github-actions Bot added the CI Continuous Integration label Jun 26, 2026
@vszakats vszakats marked this pull request as draft June 26, 2026 18:16
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
vszakats added 2 commits June 26, 2026 21:15
lib1587.c use type from private openssl.h
curl-for-win.yml enable tests in the GCC job too
@vszakats vszakats marked this pull request as ready for review June 26, 2026 19:17
@vszakats vszakats changed the title lib1587: fix -Wconversion with LibreSSL on Windows lib1587: fix gcc -Wconversion with LibreSSL on Windows Jun 26, 2026
@vszakats vszakats changed the title lib1587: fix gcc -Wconversion with LibreSSL on Windows lib1587: fix gcc -Wconversion with LibreSSL on Windows, test in CI Jun 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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_t in lib/vtls/openssl.h (with LibreSSL/BoringSSL/OpenSSL-family sizing) and reuse it from the test.
  • Remove the duplicate ctx_option_t typedef from lib/vtls/openssl.c (now provided by the header).
  • Enable building curl tests in the curl-for-win Windows x64 gcc CI job via CW_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.

@vszakats vszakats closed this in 9f9d2d1 Jun 26, 2026
@vszakats vszakats deleted the lib1587 branch June 26, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build CI Continuous Integration tests TLS Windows Windows-specific

Development

Successfully merging this pull request may close these issues.

2 participants