cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_easy_getinfo expects a pointer to char * for this info

From: Lars Nilsson <chamaeleon_at_gmail.com>
Date: Mon, 14 Mar 2011 12:42:09 -0400

On Mon, Mar 14, 2011 at 12:33 PM, Felix E. Klee <felix.klee_at_inka.de> wrote:
> Code snippet:
>
>  char *data = malloc(100);
>  if (data != NULL)
>    curl_easy_getinfo(handle, CURLINFO_PRIVATE, data);
>
> Compilation:
>
>  $ gcc -c -Wall -O3 -o retrieval.o retrieval.c
>  retrieval.c: In function "on_wsquery_done":
>  retrieval.c:129: warning: "wsquery" may be used uninitialized in this
>  function
>  In function "on_wsquery_done",
>      inlined from "retrieval_retrieve" at retrieval.c:289:
>  retrieval.c:122: warning: call to "_curl_easy_getinfo_err_string"
>  declared with attribute warning: curl_easy_getinfo expects a pointer
>  to char * for this info
>
> Any idea how to get rid of the warning?

By passing a pointer to char *, accomplished by using &data in the
call instead of data.

Lars Nilsson

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-03-14