curl-library
Re: curl_easy_setopt and typeof
Date: Mon, 14 Apr 2008 10:37:14 -0400
On Mon, Apr 14, 2008 at 03:23:21PM +0200, Daniel Stenberg wrote:
> On Mon, 14 Apr 2008, David Shaw wrote:
>
>> It sounds like there is a hidden gotcha awaiting these people.
>
> This certainly is, and this typecheck warning thing could be a good way to
> start making people aware of it...
>
> Perhaps, and just perhaps, this is a reason to consider changing the API
> slightly for libcurl v8 (assuming there will be one! ;-).
I think that for those options where int makes sense, it might be good
to take an int, so passing a constant works. Of course, then that
raises the issue that people who did it correctly today (passing a
long, or casting to long), may have problems. Hard to make everyone
happy here.
Also, one thing worth noting about the example I gave earlier:
curl_easy_setopt( curl, CURLOPT_MAXREDIRS, -1 );
If that -1 does become 4294967295 (rather than crashing), well, that's
not truly an infinite number of redirects, but 4294967295 is still a
redirect per second for 136 years.
David
Received on 2008-04-14