From nobody Thu May 23 22:09:38 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 4Vlj5K6htGz5LRHR for ; Thu, 23 May 2024 22:09:41 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vlj5K4nKTz4Hrc; Thu, 23 May 2024 22:09:41 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTPS id A5YhsSs4zdrxEAGd2swjKV; Thu, 23 May 2024 22:09:40 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id AGd0sb1tepsbgAGd1sjvoB; Thu, 23 May 2024 22:09:40 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=Ff+Ux4+6 c=1 sm=1 tr=0 ts=664fbea4 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=TpHVaj0NuXgA:10 a=y3olD_i8AAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=itBukuqtvSBKKh9pf3EA:9 a=CjuIK1q_8ugA:10 a=2GdgqtpztZvaxdPX1XqS:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 3DD4E39B; Thu, 23 May 2024 15:09:38 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 324A01BD; Thu, 23 May 2024 15:09:38 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Brooks Davis cc: Chris , freebsd-hackers Subject: Re: incompatible integer to pointer conversion In-reply-to: References: <2e83baa48d2686b8024021668a7d334c@bsdforge.com> Comments: In-reply-to Brooks Davis message dated "Thu, 23 May 2024 21:50:38 -0000." 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 Content-Type: text/plain; charset=us-ascii Date: Thu, 23 May 2024 15:09:38 -0700 Message-Id: <20240523220938.324A01BD@slippy.cwsent.com> X-CMAE-Envelope: MS4xfPhLNPuWREccYcwcJJS3FcA/ih5A57zwQO+RkRFDaZiscqaCKUOWwzIM0SBvt51zAB9TpDoOwXXlUVNfyeDhcU9tUvIOe9s+hW/bBZWgQbiCwuyF8ARr pFaZgZxMDNgIAw+44bK92EYt7JUpSujDfuQsxkiBHeHTkhOjdPZPqtPe4N4x1asKA3HlFtzIYou19za1kJab1xEVFbO1MxKdg5SjZCsD2H3PBbsaANtmRDso 5Pp63Se5C8lte+/XM2PcrrFP9e463du7G2qPve71AMU= 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:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Queue-Id: 4Vlj5K4nKTz4Hrc 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 > > -- Brooks > -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0