From nobody Thu May 23 21:50: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 4VlhgM5RbZz5LPHD for ; Thu, 23 May 2024 21:50:39 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlhgM3YPkz4DqD; Thu, 23 May 2024 21:50:39 +0000 (UTC) (envelope-from brooks@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716501039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BO6cNfgqR89LOadKIBr95q2+zWmlyRDemEVe7LsumlE=; b=RDTfyLZWpuGk/9q0PoN2BbV90XMjrcWGUDjWCMFcvmcr129vn4JUQfqyNflEQ40QMxkt4r x49NX9SzxXRotaE6s5n0eMgxkqB1zaiPPQEHuzdYeTEFQH5vLgdA3FC8IjCILQeDDT3w5n USo+Dytw6IA/J4sRs3ZEBnxIN3vgJK/BYyOIK8aQPh1M+HyZfGeQKB4fQWV8SdQfDbrf2p am7bFyRSqw2A0eUNBQxsm5jR76+gIYlhQjgyiO/HCLVEMaGztubCkBatGCKYO/QDo9PrG9 JaPMmWjqkRR4hWi9JKPwxW4QWNsiOVoO34svBPXl0YOE5WflgqB1sNpdkd4Pmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716501039; a=rsa-sha256; cv=none; b=InMNYjxJbaB4YcW/dokMta4Ui2PmevAUTDJGrngdE+zbPuh4mF7ocuLv/DBkhg3Qe59d+a OoL7yWQeUqV87b+ZnsyTDxR//+IlbWj9KK9ecfSPwMXnv7qtH0LMZIiprZIe0SClBFpnWd 5rDNRsDb22ZMifBa2whfD68DgNFHSr4NOHBSkSotOJ41BPyhC+DZBHH7hphjYPZgD5dgwe GI8+aeWgwS/Qg15wI8M8gWrG6z0UOZBB5405zkIfE3CfBpV6d7dVspWqQv903LJ1IH7Ovr k5lwn/B34Y24uU4Za5p6OGsBkxlESvgnyyijZ60sZomIZ0Foeqd24rH9B8OrPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716501039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BO6cNfgqR89LOadKIBr95q2+zWmlyRDemEVe7LsumlE=; b=GCI5JJAYvBhbTh4RxQ0dBlkxFej/BjPpMIX0qw3APFJU4T7nFlBsRhhJSrOPiMf588I0Hs nYUHRNM1mZry7Kx+q5Tm0N+viqeYs5aIyJduIR0f8ZT39M/DV6jBAZ7NnvrUYKxL1newDY ZuDJjCWlMvnMJdL7ePlJ9Y1rLb2iaWIFGhGbtr779W7wwkrzVNbc0OjHPzDmIVlLT6XxyX FBT7snk3s1POtUZ2zf7mp5l32TCzvwN2RzR612PyBfnjdzQNhRQ5OIlm27d4amqr8qIHh8 rcS7Qi8RbrDfYCvAR7S1q92L50nViTQDhbAyHejr59TmDlwiDCb32EkDJdF+WA== Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (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 did not present a certificate) (Authenticated sender: brooks/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4VlhgM2tRVzLg8; Thu, 23 May 2024 21:50:39 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id AA5F03C019B; Thu, 23 May 2024 21:50:38 +0000 (UTC) Date: Thu, 23 May 2024 21:50:38 +0000 From: Brooks Davis To: Chris Cc: freebsd-hackers Subject: Re: incompatible integer to pointer conversion Message-ID: References: <2e83baa48d2686b8024021668a7d334c@bsdforge.com> 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 Content-Disposition: inline In-Reply-To: <2e83baa48d2686b8024021668a7d334c@bsdforge.com> 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? -- Brooks