Hello,


I may have hit a bug while using libcurl, a common library for network
operations, on gcc 8.3.0.


Building this program


  #include <curl/curl.h>

  int
  main (void)
  {
    float a;

    curl_easy_setopt (NULL, 0, (void *) a);
  }


with "gcc -c bug.c" gives


  bug.c: In function ‘main’:
  bug.c:15:3: error: cannot convert to a pointer type
     curl_easy_setopt (NULL, 0, (void *) a);
     ^~~~~~~~~~~~~~~~
  bug.c:15:3: error: cannot convert to a pointer type
  bug.c:15:3: error: cannot convert to a pointer type
  bug.c:15:3: error: cannot convert to a pointer type
  [...]
  bug.c:15:3: error: cannot convert to a pointer type
  In file included from /usr/include/x86_64-linux-gnu/curl/curl.h:2826,
                   from bug.c:1:
  bug.c:15:3: error: cannot convert to a pointer type
     curl_easy_setopt (NULL, 0, (void *) a);
     ^~~~~~~~~~~~~~~~
  bug.c:15:3: error: cannot convert to a pointer type
     curl_easy_setopt (NULL, 0, (void *) a);
     ^~~~~~~~~~~~~~~~
  bug.c:15:3: error: cannot convert to a pointer type
     curl_easy_setopt (NULL, 0, (void *) a);
     ^~~~~~~~~~~~~~~~


The error message is correct, but is repeated tens of times.
The function is declared this way in curl.h

  CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option,
  ...);

but I couldn't replicate the bug by copying that line only.



Thanks,

Andrea Monaco

Reply via email to