examples: fix build issues in 'complicated' examples

- 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 4a6bdd5899 #18908
Cherry-picked from #18909
Closes #18914
This commit is contained in:
Viktor Szakats 2025-10-07 13:54:17 +02:00
parent 53be8166b2
commit 6bb7714032
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
6 changed files with 36 additions and 24 deletions

View file

@ -52,12 +52,13 @@ static const char * const urls[]= {
"https://www4.example.com/",
};
static void *pull_one_url(void *url)
static void *pull_one_url(void *pindex)
{
int i = *(int *)pindex;
CURL *curl;
curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_URL, urls[i]);
/* this example does not verify the server's certificate, which means we
might be downloading stuff from an impostor */
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
@ -82,7 +83,7 @@ int main(int argc, char **argv)
int error = pthread_create(&tid[i],
NULL, /* default attributes please */
pull_one_url,
(void *)urls[i]);
(void *)&i);
if(error)
fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error);
else