curl-library
Re: curl_easy_setopt() typechecker, try2
Date: Wed, 27 Feb 2008 12:54:39 +0100
Daniel Stenberg wrote:
> 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.
That's strange, did you compile with optimizations? My gcc is only a few
days newer:
gcc version 4.3.0 20080221 (prerelease) [gcc-4_3-branch revision 132521]
(SUSE Linux)
but it works with -O and higher:
$ cat test.c
#include <curl/curl.h>
int main()
{
CURL *h = curl_easy_init();
curl_easy_setopt(h, CURLOPT_URL, 2);
curl_easy_perform(h);
return 0;
}
$ gcc -O -Wall -I ./include/ -lcurl test.c
test.c: In function ‘main’:
test.c:6: warning: call to ‘_curl_easy_setopt_err_string’ declared with
attribute warning: curl_easy_setopt expects a string (char* or char[])
argument for this option
Michal
Received on 2008-02-27