public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrea Monaco <andrea.monaco@autistici.org>
To: gcc@gcc.gnu.org
Subject: "cannot convert to a pointer type" error repeated tens of times
Date: Sat, 12 Feb 2022 21:32:58 +0100	[thread overview]
Message-ID: <87v8xjddvp.fsf@autistici.org> (raw)


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	other threads:[~2022-02-12 20:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-12 20:32 Andrea Monaco [this message]
2022-02-12 20:55 ` Marc Glisse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v8xjddvp.fsf@autistici.org \
    --to=andrea.monaco@autistici.org \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).