-
-
Notifications
You must be signed in to change notification settings - Fork 7k
examples: fix build issues in 'complicated' examples #18914
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
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
```
/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
1 task
bagder
reviewed
Oct 7, 2025
docs/examples/cacertinmem.c
Outdated
| sk_X509_INFO_pop_free(inf, X509_INFO_free); | ||
| #if defined(__clang__) && __clang_major__ >= 16 | ||
| #pragma clang diagnostic pop | ||
| #endif |
Member
There was a problem hiding this comment.
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
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
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.
-Wcast-function-type-strict.Follow-up to 4a6bdd5 #18908
Cherry-picked from #18909