From nobody Thu May 23 22:09:05 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 4Vlj4n00wDz5LR85 for ; Thu, 23 May 2024 22:09:13 +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 4Vlj4m5lPVz4GxJ; Thu, 23 May 2024 22:09:12 +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 44NM96iM093268; Thu, 23 May 2024 15:09:12 -0700 (PDT) (envelope-from bsd-lists@bsdforge.com) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ultimatedns.net; s=mx99; t=1716502152; x=1716502752; r=y; bh=DoY8+8+fZE6Lrq7pLxAn38WSvaNuwAOlzzuCWzG7Yuk=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=u6ODqSQayUzSf8BJzPjBQUNvmouPVTUSpAHDHCFZTbRzPB86RygxH9khbrEnvMq/5 orKKLiNdJXvFwbWslOUM8g8jen73hUtcHfHz/CfR2oEtBrvubDz88S+xSGWRU88FUr 8d5Xt9f5Tcg/Gsmq934PWG+CiMys1AKDw/CShz118D+IOnSPAZQAfqK9aZt+OVhER3 bHVr753NW0SAV0qOE51jvXCNpxNg4tJ0jMzvHPx+kOI2K6RH41mixjDlPQgO5EUxae NC5ODwIkrxBc2thq4lVDK4XPn9q8poyooOeeFni1t1EtivYuyLxi05fwwPiygOtzLs 0RVq2QjslphSw== 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:09:05 -0700 From: Chris To: Brooks Davis Cc: freebsd-hackers Subject: Re: incompatible integer to pointer conversion In-Reply-To: References: <2e83baa48d2686b8024021668a7d334c@bsdforge.com> User-Agent: UDNSMS/17.0 Message-ID: <2b0dc8ef2cca4945af74f4992af5fc06@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: 4Vlj4m5lPVz4GxJ On 2024-05-23 14:50, Brooks Davis wrote: > 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 >> assigning >> 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? Yep. Loads of them. That's what I needed. I've got it now. Thanks a million for the reply, Brooks. > > -- Brooks --Chris