From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sourceware.org (Postfix) with ESMTPS id 1E02D3858423 for ; Sat, 12 Feb 2022 20:55:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1E02D3858423 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=inria.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=inria.fr X-IronPort-AV: E=Sophos;i="5.88,364,1635199200"; d="scan'208";a="21052556" Received: from 85-171-189-19.rev.numericable.fr (HELO hippo) ([85.171.189.19]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Feb 2022 21:55:31 +0100 Date: Sat, 12 Feb 2022 21:55:27 +0100 (CET) From: Marc Glisse Reply-To: gcc@gcc.gnu.org To: Andrea Monaco cc: gcc@gcc.gnu.org Subject: Re: "cannot convert to a pointer type" error repeated tens of times In-Reply-To: <87v8xjddvp.fsf@autistici.org> Message-ID: References: <87v8xjddvp.fsf@autistici.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Feb 2022 20:55:33 -0000 On Sat, 12 Feb 2022, Andrea Monaco via Gcc wrote: > #include > > 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