cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_easy_setopt() typechecker, try2

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 27 Feb 2008 11:39:06 +0100 (CET)

On Tue, 26 Feb 2008, Michal Marek wrote:

> I split the patch into the typechecker itself and a patch that silences the
> warnings found in curl sources.

Thanks, I committed the warnings fix.

> I omitted warnings about passing int instead of long for now, because I'm
> undecided whether to warn about this or not. What do you think? While it's
> not standard C, it "seems to work" pretty much everywhere...

For platforms where ints and longs are of the same size, I don't think they
will be appreciated much but they should be relevant on archs with 64 bit
longs...

> It's still C only, I want to tackle issues with the C version first

I applied the patch locally and I installed gcc 4.3 for the purpose of testing
out your work (gcc-4.3 (Debian 4.3-20080219-1) 4.3.0 20080219 (prerelease)
[gcc-4_3-branch revision 132456]) but for some reason I can't get it to
produce any warnings when I try to build a test application using this
compiler and some funky bad usages of curl_easy_setopt() ... I'm a bit puzzled
why.

For debugging, I added a line in curl/curl.h that defines CURL_TYPECHECKED if
the typecheck header is included and in my test app I check for that define
and I also check if _curl_string_option is defined and but equal true but I
can still do:

         curl_easy_setopt(curl, CURLOPT_URL, 2);

... without getting a warning out of this!

Can this kind of warning somehow be disabled in gcc (I'm using a Debian
package which I don't know of they do anything fun with) and require some kind
of enabling on the command line?

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