Skip to content

Conversation

@vszakats
Copy link
Member

@vszakats vszakats commented Oct 7, 2025

  • cacertinmem: build cleanly with BoringSSL/AWS-LC.
  • cacertinmem: silence -Wcast-function-type-strict.
  • multi-uv: fix callback prototypes.
  • multithread, threaded-ssl: do not pass const as thread arg.
  • sessioninfo: fix suppressing deprecated feature warning.
  • usercertinmem: sync formatting with cacertinmem.

Follow-up to 4a6bdd5 #18908
Cherry-picked from #18909

```
/home/runner/work/curl/curl/docs/examples/multi-uv.c: In function ‘main’:
/home/runner/work/curl/curl/include/curl/typecheck-gcc.h:219:13: error: call to ‘Wcurl_multi_setopt_err_socketcb’ declared with attribute warning: curl_multi_setopt expects a curl_socket_callback argument [-Werror=attribute-warning]
  219 |             Wcurl_multi_setopt_err_socketcb();                          \
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/curl/curl/docs/examples/multi-uv.c:241:3: note: in expansion of macro ‘curl_multi_setopt’
  241 |   curl_multi_setopt(uv.multi, CURLMOPT_SOCKETFUNCTION, cb_socket);
      |   ^~~~~~~~~~~~~~~~~
/home/runner/work/curl/curl/include/curl/typecheck-gcc.h:222:13: error: call to ‘Wcurl_multi_setopt_err_timercb’ declared with attribute warning: curl_multi_setopt expects a curl_multi_timer_callback argument [-Werror=attribute-warning]
  222 |             Wcurl_multi_setopt_err_timercb();                           \
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/curl/curl/docs/examples/multi-uv.c:243:3: note: in expansion of macro ‘curl_multi_setopt’
  243 |   curl_multi_setopt(uv.multi, CURLMOPT_TIMERFUNCTION, cb_timeout);
      |   ^~~~~~~~~~~~~~~~~
```
https://github.com/curl/curl/actions/runs/18315062058/job/52153011616?pr=18909#step:41:32
```
/home/runner/work/curl/curl/docs/examples/sessioninfo.c: In function 'wrfu':
/home/runner/work/curl/curl/include/curl/curl.h:52:7: error: expected expression before '#pragma'
   52 |       _Pragma("GCC diagnostic push") \
      |       ^~~~~~~
/home/runner/work/curl/curl/docs/examples/sessioninfo.c:52:9: note: in expansion of macro 'CURL_IGNORE_DEPRECATION'
   52 |   res = CURL_IGNORE_DEPRECATION(
      |         ^~~~~~~~~~~~~~~~~~~~~~~
```
https://github.com/curl/curl/actions/runs/18311842914/job/52142369921?pr=18909#step:5:981
@vszakats vszakats changed the title examples: fix build issues in "complicated" examples examples: fix build issues in 'complicated' examples Oct 7, 2025
sk_X509_INFO_pop_free(inf, X509_INFO_free);
#if defined(__clang__) && __clang_major__ >= 16
#pragma clang diagnostic pop
#endif
Copy link
Member

Choose a reason for hiding this comment

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

To increase the readability of this example code, how about just moving this pragma to the top and not care about popping it in the end?

@vszakats vszakats closed this in 6bb7714 Oct 7, 2025
@vszakats vszakats deleted the excompl branch October 7, 2025 15:15
vszakats added a commit that referenced this pull request Oct 7, 2025
Build these examples when the necessary dependencies are present:
- cacertinmem, usercertinmem (OpenSSL/fork)
- multi-uv (libuv)
- multithread, threaded-ssl (pthread)
- sessioninfo (GnuTLS)

Indicate the necessary dependency via a `Required:` comment placed in
the source file. A single dependency per source is supported as of now.
The name of the dependency should match the variable used within
the cmake scripts, which in turn matches the macro used in the config
header. E.g. for GnuTLS it's `USE_GNUTLS`.

Also:
- GHA/macos: build examples in two job to test GnuTLS and pthread ones.
- GHA/linux: enable libuv to test it with examples.

Follow-up to 6bb7714 #18914
Closes #18909
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.

2 participants