cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: rfc: curl_easy_setopt() typechecker

From: Michal Marek <mmarek_at_suse.cz>
Date: Tue, 26 Feb 2008 10:07:56 +0100

Daniel Stenberg wrote:
> On Mon, 25 Feb 2008, Michal Marek wrote:
>> 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?

As I wrote, one downside is that currently the checking is quite strict
wrt callbacks. The other option is to just check that sizeof(arg) ==
sizeof(void(*)(void)), which is too loose...

Another one which I forgot to mention before is that if the option
argument is an expression that itself generates a warning, the warning
will be output multiple times, each time the __typeof__ keyword is
applied to the expression.

But it shouldn't break stuff, just add some not-so-helpful warnings or
multiply existing ones.

Michal
Received on 2008-02-26