From: Marc Glisse <marc.glisse@inria.fr>
To: Andrea Monaco <andrea.monaco@autistici.org>
Cc: gcc@gcc.gnu.org
Subject: Re: "cannot convert to a pointer type" error repeated tens of times
Date: Sat, 12 Feb 2022 21:55:27 +0100 (CET) [thread overview]
Message-ID: <d3615ba9-77e0-d0dd-39f7-a12486b928e@hippo.saclay.inria.fr> (raw)
In-Reply-To: <87v8xjddvp.fsf@autistici.org>
On Sat, 12 Feb 2022, Andrea Monaco via Gcc wrote:
> #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,
> ...);
No, curl_easy_setopt is a macro. If you look at the preprocessed code, you
get many statements doing the same wrong operation, and one warning for
each of them.
(wrong list, should be gcc-help, or an issue on bugzilla)
--
Marc Glisse
prev parent reply other threads:[~2022-02-12 20:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-12 20:32 Andrea Monaco
2022-02-12 20:55 ` Marc Glisse [this message]
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=d3615ba9-77e0-d0dd-39f7-a12486b928e@hippo.saclay.inria.fr \
--to=marc.glisse@inria.fr \
--cc=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).