curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: curl_easy_setopt type checking for C++

From: WebMC via curl-library <curl-library_at_cool.haxx.se>
Date: Tue, 17 Dec 2019 10:27:14 +0100

Le 09/12/2019 à 22:37, Jeff Mears via curl-library a écrit :
> As an example, the following:
> curl_easy_setopt(easy, CURLOPT_NOSIGNAL, 1);
> In C, this is broken. 1 is an "int", but the parameter is defined as "long".

what about "implicit cast" ? the argument is passed as "(long)1", right?

you can have problem with the reverse cast, because the final type may
be unable to describe the first value, or with pointers

ChD
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-12-17