From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 8 12:41:22 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7EC0716A4CE for ; Fri, 8 Oct 2004 12:41:22 +0000 (GMT) Received: from bgezal.inso.tuwien.ac.at (bgezal.inso.tuwien.ac.at [128.130.59.74]) by mx1.FreeBSD.org (Postfix) with ESMTP id 14D5D43D48 for ; Fri, 8 Oct 2004 12:41:22 +0000 (GMT) (envelope-from stefan@fafoe.narf.at) Received: from fafoe.narf.at (unknown [212.186.3.235]) by bgezal.inso.tuwien.ac.at (Postfix) with ESMTP id 962402177; Fri, 8 Oct 2004 14:41:20 +0200 (CEST) Received: from wombat.fafoe.narf.at (wombat.fafoe.narf.at [192.168.1.42]) by fafoe.narf.at (Postfix) with ESMTP id 6F3DD40EE; Fri, 8 Oct 2004 14:41:14 +0200 (CEST) Received: by wombat.fafoe.narf.at (Postfix, from userid 1001) id 04F63D7; Fri, 8 Oct 2004 14:41:12 +0200 (CEST) Date: Fri, 8 Oct 2004 14:41:12 +0200 From: Stefan Farfeleder To: Andreas Klemm Message-ID: <20041008124108.GA59642@wombat.fafoe.narf.at> Mail-Followup-To: Andreas Klemm , hackers@freebsd.org, "Jonathan A. Zdziarski" References: <20041005054213.GA11770@lesanti.hq.sinectis.com.ar> <416234B1.8020406@nuclearelephant.com> <20041005202816.GA14973@titan.klemm.apsfilter.org> <20041005205040.GH31397@lesanti.hq.sinectis.com.ar> <20041006060437.GA23364@titan.klemm.apsfilter.org> <20041006144220.GA29653@lesanti.hq.sinectis.com.ar> <20041007111139.GA16296@titan.klemm.apsfilter.org> <416579E1.8050308@nuclearelephant.com> <20041007174322.GB3414@titan.klemm.apsfilter.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041007174322.GB3414@titan.klemm.apsfilter.org> User-Agent: Mutt/1.5.6i cc: hackers@freebsd.org cc: "Jonathan A. Zdziarski" Subject: Re: please help with: warning: initialization makes integer from pointer X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2004 12:41:22 -0000 On Thu, Oct 07, 2004 at 07:43:22PM +0200, Andreas Klemm wrote: > Dear FreeBSD hackers, > > could somebody please help Jonathan, the dspam owner, how to code > this best under FreeBSD ? > s->p_getpwnam = (struct passwd) { NULL, NULL, 0, 0, NULL, NULL, NULL }; > ^^^^^^^^^^^^^^^^^^^^ ! > s->p_getpwuid = (struct passwd) { NULL, NULL, 0, 0, NULL, NULL, NULL }; > ^^^^^^^^^^^^^^^^^^^^ ! This works but might cause (harmless) warnings about missing initialisers: s->p_getpwnam = (struct passwd) { 0 }; s->p_getpwuid = (struct passwd) { 0 }; Alternatively: static struct passwd zero_pwd; s->p_getpwnam = zero_pwd; s->p_getpwuid = zero_pwd; Cheers, Stefan