From nobody Thu May 23 23:12:58 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 4VlkVX72Hpz5LXP8 for ; Thu, 23 May 2024 23:13:08 +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 4VlkVW4dbDz4Qm3; Thu, 23 May 2024 23:13:07 +0000 (UTC) (envelope-from bsd-lists@bsdforge.com) Authentication-Results: mx1.freebsd.org; dkim=fail ("headers rsa verify failed") header.d=ultimatedns.net header.s=mx99 header.b=YcoyxbdG; spf=none (mx1.freebsd.org: domain of bsd-lists@bsdforge.com has no SPF policy when checking 24.113.41.81) smtp.mailfrom=bsd-lists@bsdforge.com Received: from ultimatedns.net (localhost [127.0.0.1]) by udns.ultimatedns.net (8.16.1/8.16.1) with ESMTP id 44NNCxBt079479; Thu, 23 May 2024 16:13:05 -0700 (PDT) (envelope-from bsd-lists@bsdforge.com) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ultimatedns.net; s=mx99; t=1716505985; x=1716506585; r=y; bh=Swl+n0RQgsyl6GuvOtdBa9MXnk5wGHDGv5Pxiu13nPY=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=YcoyxbdGPENHUM3aUrwzAQPV0cgms9GvNXWuoOP1/9cTbsD6OCYrzozCSG1hK281z lE/KlB4Uj9mvF1zbewpVf+qSZu+ZOFfS80Us+Hj3Kkvd/5A7oImRYfeIUlfPsaPtH/ 1wBEemNIWr7DPaHRv73nIMrHNizB3o27feZtuJ0KLLQKsz8avvYM0k0uyPY8OzXRQV +6SgbrI8DzJh6SF0VU5p3i/BmQH+URLQ2h4o3OJTjkHcERotJgA6vJUCLO6Odb/U/Q uzP6amymzqbBL1b4axpAJaKQkeMdLSllgX27DnvQbn7/SYZPv0q/seE6x3Jv6ZVMHn DMtTjYMJ9BryA== 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 16:12:58 -0700 From: Chris To: Cy Schubert Cc: Brooks Davis , freebsd-hackers Subject: Re: incompatible integer to pointer conversion In-Reply-To: <402e05f251baab2d4903201dcb207775@bsdforge.com> References: <2e83baa48d2686b8024021668a7d334c@bsdforge.com> <20240523220938.324A01BD@slippy.cwsent.com> <402e05f251baab2d4903201dcb207775@bsdforge.com> User-Agent: UDNSMS/17.0 Message-ID: <7780ce78a3bdef9d1a79f6f051e3373e@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=multimap; Matched map: local_wl_ip X-Spamd-Result: default: False [1.00 / 15.00]; R_DKIM_REJECT(1.00)[ultimatedns.net:s=mx99]; ONCE_RECEIVED(0.10)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_NA(0.00)[no SPF record]; ASN(0.00)[asn:11404, ipnet:24.113.0.0/16, country:US]; local_wl_ip(0.00)[24.113.41.81]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[ultimatedns.net:-] X-Rspamd-Queue-Id: 4VlkVW4dbDz4Qm3 On 2024-05-23 15:28, Chris wrote: > 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 Well FWIW. I used the define you pointed at, and all's well for my current task. Case closed. Thanks again, Cy && Brooks! > > Thanks for the pointer, Cy. Greatly appreciated! >> >>> >>> -- Brooks >>> > --Chris --Chris