cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: rfc: curl_easy_setopt() typechecker

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 25 Feb 2008 22:58:07 +0100 (CET)

On Mon, 25 Feb 2008, Michal Marek wrote:

> I played a bit with various extensions available in gcc and hacked together
> a set of macros that allow for compile-time checking of parameters passed to
> curl_easy_setopt(). The result is attached to this mail as a patch, but
> needs probably a bit of explanation :) Also, the patch isn't meant to be
> checked in as it is now.

[...]

> Now the question: are you interested in this?

I am! I think this is very cool work, and even if it still depends on a stuff
not that many users have right now, it'll only be a matter of time until they
do, and I would say that accidental passing of bad types to curl_easy_setopt()
has been causing hard-to-find problems for many users. In fact to the extent
that I've had my doubts on the cleverness of this design. (But not to the
extent that I've considered giving it up, since we've been too far down the
road to change it now.)

> I can offer maintaining the typecheck-gcc.h file and/or documenting exactly
> how to maintain it. Also, it's easy to extend this to cover other libcurl
> functions (curl_easy_getinfo() is probably even more interesting than
> curl_easy_setopt() due to the pointers involved) if there's interest.

I'd like that very much. Have you found any obvious downsides with enabling
this for everyone that has the suitable gcc version when they build their
libcurl-based apps?

Regarding the CURLOPT_SSLENGINE_DEFAULT option not using three args, I
consider that a bug more than anything else.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2008-02-25