From nobody Thu May 23 22:28:13 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VljVt4Y14z5LSgH for ; Thu, 23 May 2024 22:28:22 +0000 (UTC) (envelope-from bsd-lists@bsdforge.com) Received: from udns.ultimatedns.net (udns.ultimatedns.net [24.113.41.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "ultimatedns.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VljVs6JDgz4Lq1; Thu, 23 May 2024 22:28:21 +0000 (UTC) (envelope-from bsd-lists@bsdforge.com) Authentication-Results: mx1.freebsd.org; none Received: from ultimatedns.net (localhost [127.0.0.1]) by udns.ultimatedns.net (8.16.1/8.16.1) with ESMTP id 44NMSD9J013401; Thu, 23 May 2024 15:28:19 -0700 (PDT) (envelope-from bsd-lists@bsdforge.com) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ultimatedns.net; s=mx99; t=1716503299; x=1716503899; r=y; bh=WVahWo5VkwyImqnUPfKSZmpB+ss9X6wwp5KWYslBAro=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=fhMq3BrBFHCBZSbeyavo7X0hH1BmPHadwuIrpNlCXyJHzTyuQt7WC09Qsx9enSIZW lK8st79iIycTEGbocueZSH0biDNkRh9QcfL6e9h0IY/ONh+ZVChjguwCZsqn/UodR6 dP9SsMGW0e75gtMrFBhwJ5WvQLklf6j8AslriHGayKFONXmw8NZ4QJ2U/hO/ezpT5P Tq0YxcqLQIrj7WA92nr4l2ajCUzPyscNRjsdQSjs11A8h5BWRnFtL8Zyr9WG8QPQb+ OnOBsjhF+dfxTmF/vrghZy0UODmfnVLZQurlUPtyA7JxP16CydUB7QdCA3RIkffwHV Jqg5jSC/VcjJA== List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Date: Thu, 23 May 2024 15:28:13 -0700 From: Chris To: Cy Schubert Cc: Brooks Davis , freebsd-hackers Subject: Re: incompatible integer to pointer conversion In-Reply-To: <20240523220938.324A01BD@slippy.cwsent.com> References: <2e83baa48d2686b8024021668a7d334c@bsdforge.com> <20240523220938.324A01BD@slippy.cwsent.com> User-Agent: UDNSMS/17.0 Message-ID: <402e05f251baab2d4903201dcb207775@bsdforge.com> X-Sender: bsd-lists@bsdforge.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:11404, ipnet:24.113.0.0/16, country:US] X-Rspamd-Queue-Id: 4VljVs6JDgz4Lq1 On 2024-05-23 15:09, Cy Schubert wrote: > In message , Brooks Davis > writes: >> On Thu, May 23, 2024 at 02:40:59PM -0700, Chris wrote: >> > Sorry, this is really a basic "programming in C 101" question. >> > But for the life of me, I'm not getting it. The source in >> > question: >> > >> > LDAP *setup_ldap() >> > { >> > LDAP *ret; >> > int n; >> > >> > if (debug) fprintf(stderr, "radldap: Setting up LDAP for %s, port %d\n" >> , >> > host, port); >> > if (!(ret = ldap_init(host, port))) { >> > fprintf(stderr, "radldap: Could not initialize LDAP!\n"); >> > _exit(2); >> > } >> > >> > Now *you* can probably already see the problem. But this is what's returned >> : >> > >> > radldap.c:302:12: error: incompatible integer to pointer conversion assigni >> ng >> > to 'LDAP *' (aka 'struct ldap *') from 'int' [-Wint-conversion] >> > 302 | if (!(ret = ldap_init(host, port))) { >> > | ^ ~~~~~~~~~~~~~~~~~~~~~ >> > >> > Thanks in advance for any hints, or pointers. >> > >> >> Have you included ldap.h? Are there any warnings about implicit >> declarations? > > ldap.h includes this as well: > > #if LDAP_DEPRECATED > LDAP_F( LDAP * ) > ldap_init LDAP_P(( /* deprecated, use ldap_create or ldap_initialize */ > LDAP_CONST char *host, > int port )); > > LDAP_F( LDAP * ) > ldap_open LDAP_P(( /* deprecated, use ldap_create or ldap_initialize */ > LDAP_CONST char *host, > int port )); > #endif > > Apps such as dovecot and apr-1 have, > > #define LDAP_DEPRECATED 1 Heh. Based on the volumes of warns I'm seeing, I can understand why. My "quick fix" just turned into a bit of a project. :( Thanks for the pointer, Cy. Greatly appreciated! > >> >> -- Brooks >> --Chris