Skip to content

Conversation

@vszakats
Copy link
Member

@vszakats vszakats commented Jun 16, 2025

Sync build properties with libtests.

This allows accessing macros from curl_config.h, for feature flags.
Smoothens out platform bumps, allowing to drop local replicas from
client sources. It enables using Windows wrappers, e.g. for fopen().

Also fix client sources to use curl_mfprintf() where curl format
strings are used. (To avoid build failure with older mingw-w64, e.g.
6.4.0 in CI.)

Follow-up to 739c09c #17627

vszakats added 5 commits June 16, 2025 21:54
client: fixup curlx for static libcurl (like in libtests)
to avoid fallout with older mingw-w64 (dl-mingw, CM 6.4.0-i686 schannel !unity):
```
tests/http/clients/h2_pausing.c: In function 'cb':
tests/http/clients/h2_pausing.c:58:21: error: unknown conversion type character 'l' in format [-Werror=format=]
     fprintf(stderr, "INFO: [%d] write, Content-Length %"CURL_FORMAT_CURL_OFF_T
                     ^
tests/http/clients/h2_pausing.c:58:21: error: too many arguments for format [-Werror=format-extra-args]
     fprintf(stderr, "INFO: [%d] write, Content-Length %"CURL_FORMAT_CURL_OFF_T
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tests/http/clients/h2_pausing.c:58:21: error: unknown conversion type character 'l' in format [-Werror=format=]
     fprintf(stderr, "INFO: [%d] write, Content-Length %"CURL_FORMAT_CURL_OFF_T
                     ^
tests/http/clients/h2_pausing.c:58:21: error: too many arguments for format [-Werror=format-extra-args]
     fprintf(stderr, "INFO: [%d] write, Content-Length %"CURL_FORMAT_CURL_OFF_T
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from bld/tests/http/clients/clients.c:7:0:
tests/http/clients/h2_upgrade_extreme.c: In function 'test_h2_upgrade_extreme':
tests/http/clients/h2_upgrade_extreme.c:121:27: error: unknown conversion type character 'l' in format [-Werror=format=]
           fprintf(stderr, "transfer #%" CURL_FORMAT_CURL_OFF_T
                           ^~~~~~~~~~~~~
tests/http/clients/h2_upgrade_extreme.c:121:27: error: format '%d' expects argument of type 'int', but argument 3 has type 'curl_off_t {aka long long int}' [-Werror=format=]
tests/http/clients/h2_upgrade_extreme.c:121:27: error: too many arguments for format [-Werror=format-extra-args]
tests/http/clients/h2_upgrade_extreme.c:121:27: error: unknown conversion type character 'l' in format [-Werror=format=]
tests/http/clients/h2_upgrade_extreme.c:121:27: error: format '%d' expects argument of type 'int', but argument 3 has type 'curl_off_t {aka long long int}' [-Werror=format=]
tests/http/clients/h2_upgrade_extreme.c:121:27: error: too many arguments for format [-Werror=format-extra-args]
tests/http/clients/h2_upgrade_extreme.c:126:27: error: unknown conversion type character 'l' in format [-Werror=format=]
           fprintf(stderr, "transfer #%" CURL_FORMAT_CURL_OFF_T
                           ^~~~~~~~~~~~~
tests/http/clients/h2_upgrade_extreme.c:126:27: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'curl_off_t {aka long long int}' [-Werror=format=]
tests/http/clients/h2_upgrade_extreme.c:126:27: error: too many arguments for format [-Werror=format-extra-args]
tests/http/clients/h2_upgrade_extreme.c:126:27: error: unknown conversion type character 'l' in format [-Werror=format=]
tests/http/clients/h2_upgrade_extreme.c:126:27: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'curl_off_t {aka long long int}' [-Werror=format=]
tests/http/clients/h2_upgrade_extreme.c:126:27: error: too many arguments for format [-Werror=format-extra-args]
tests/http/clients/h2_upgrade_extreme.c:132:25: error: unknown conversion type character 'l' in format [-Werror=format=]
         fprintf(stderr, "transfer #%" CURL_FORMAT_CURL_OFF_T" retiring "
                         ^~~~~~~~~~~~~
tests/http/clients/h2_upgrade_extreme.c:132:25: error: format '%d' expects argument of type 'int', but argument 3 has type 'curl_off_t {aka long long int}' [-Werror=format=]
tests/http/clients/h2_upgrade_extreme.c:132:25: error: too many arguments for format [-Werror=format-extra-args]
tests/http/clients/h2_upgrade_extreme.c:132:25: error: unknown conversion type character 'l' in format [-Werror=format=]
tests/http/clients/h2_upgrade_extreme.c:132:25: error: format '%d' expects argument of type 'int', but argument 3 has type 'curl_off_t {aka long long int}' [-Werror=format=]
tests/http/clients/h2_upgrade_extreme.c:132:25: error: too many arguments for format [-Werror=format-extra-args]
In file included from bld/tests/http/clients/clients.c:10:0:
tests/http/clients/tls_session_reuse.c: In function 'test_tls_session_reuse':
tests/http/clients/tls_session_reuse.c:182:27: error: unknown conversion type character 'l' in format [-Werror=format=]
           fprintf(stderr, "transfer #%" CURL_FORMAT_CURL_OFF_T
                           ^~~~~~~~~~~~~
tests/http/clients/tls_session_reuse.c:182:27: error: format '%d' expects argument of type 'int', but argument 3 has type 'curl_off_t {aka long long int}' [-Werror=format=]
tests/http/clients/tls_session_reuse.c:182:27: error: too many arguments for format [-Werror=format-extra-args]
tests/http/clients/tls_session_reuse.c:182:27: error: unknown conversion type character 'l' in format [-Werror=format=]
tests/http/clients/tls_session_reuse.c:182:27: error: format '%d' expects argument of type 'int', but argument 3 has type 'curl_off_t {aka long long int}' [-Werror=format=]
tests/http/clients/tls_session_reuse.c:182:27: error: too many arguments for format [-Werror=format-extra-args]
tests/http/clients/tls_session_reuse.c:187:27: error: unknown conversion type character 'l' in format [-Werror=format=]
           fprintf(stderr, "transfer #%" CURL_FORMAT_CURL_OFF_T
                           ^~~~~~~~~~~~~
tests/http/clients/tls_session_reuse.c:187:27: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'curl_off_t {aka long long int}' [-Werror=format=]
tests/http/clients/tls_session_reuse.c:187:27: error: too many arguments for format [-Werror=format-extra-args]
tests/http/clients/tls_session_reuse.c:187:27: error: unknown conversion type character 'l' in format [-Werror=format=]
tests/http/clients/tls_session_reuse.c:187:27: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'curl_off_t {aka long long int}' [-Werror=format=]
tests/http/clients/tls_session_reuse.c:187:27: error: too many arguments for format [-Werror=format-extra-args]
tests/http/clients/tls_session_reuse.c:194:25: error: unknown conversion type character 'l' in format [-Werror=format=]
         fprintf(stderr, "transfer #%" CURL_FORMAT_CURL_OFF_T" retiring "
                         ^~~~~~~~~~~~~
tests/http/clients/tls_session_reuse.c:194:25: error: format '%d' expects argument of type 'int', but argument 3 has type 'curl_off_t {aka long long int}' [-Werror=format=]
tests/http/clients/tls_session_reuse.c:194:25: error: too many arguments for format [-Werror=format-extra-args]
tests/http/clients/tls_session_reuse.c:194:25: error: unknown conversion type character 'l' in format [-Werror=format=]
tests/http/clients/tls_session_reuse.c:194:25: error: format '%d' expects argument of type 'int', but argument 3 has type 'curl_off_t {aka long long int}' [-Werror=format=]
tests/http/clients/tls_session_reuse.c:194:25: error: too many arguments for format [-Werror=format-extra-args]
```
https://github.com/curl/curl/actions/runs/15683475099/job/44180609118?pr=17641#step:12:248
vszakats added 2 commits June 16, 2025 22:03
macOS clang-tidy job, with `mk-unity.pl --embed`:
```
/Users/runner/work/curl/curl/bld/tests/http/clients/clients.c:38:10: error: '../curl_setup.h' file not found, did you mean 'curl_setup.h'? [clang-diagnostic-error]
   38 | #include "../curl_setup.h"
      |          ^~~~~~~~~~~~~~~~~
      |          "curl_setup.h"
1 error generated.
```
https://github.com/curl/curl/actions/runs/15690634385/job/44204694573?pr=17642#step:14:248
@vszakats vszakats closed this in 539d112 Jun 16, 2025
@vszakats vszakats deleted the t-client-curl-setup branch June 16, 2025 20:26
vszakats added a commit to vszakats/curl that referenced this pull request Jun 17, 2025
Not necessary now that it uses `curl_setup.h`.

Follow-up to 539d112 curl#17642
vszakats added a commit that referenced this pull request Jun 18, 2025
Not necessary now that test clients #include `curl_setup.h`.

Follow-up to 539d112 #17642

Closes #17657
vszakats added a commit to vszakats/curl that referenced this pull request Jun 19, 2025
Not necessary now that test clients #include `curl_setup.h`.

Follow-up to 539d112 curl#17642
vszakats added a commit that referenced this pull request Jun 19, 2025
Not necessary now that test clients #include `curl_setup.h`.

Follow-up to 539d112 #17642

Closes #17668
denandz pushed a commit to denandz/curl that referenced this pull request Jun 21, 2025
Sync build properties with libtests.

This allows accessing macros from `curl_config.h`, for feature flags.
Smoothens out platform bumps, allowing to drop local replicas from
client sources. It enables using Windows wrappers, e.g. for `fopen()`.

Also fix client sources to use `curl_mfprintf()` where curl format
strings are used. (To avoid build failure with older mingw-w64, e.g.
6.4.0 in CI.)

Follow-up to 739c09c curl#17627

Closes curl#17642
denandz pushed a commit to denandz/curl that referenced this pull request Jun 21, 2025
Not necessary now that test clients #include `curl_setup.h`.

Follow-up to 539d112 curl#17642

Closes curl#17657
denandz pushed a commit to denandz/curl that referenced this pull request Jun 21, 2025
Not necessary now that test clients #include `curl_setup.h`.

Follow-up to 539d112 curl#17642

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

Development

Successfully merging this pull request may close these issues.

1 participant