From owner-cvs-all Mon Mar 24 9: 7:26 2003 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8BB6A37B407; Mon, 24 Mar 2003 09:07:23 -0800 (PST) Received: from gw.nectar.cc (gw.nectar.cc [208.42.49.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4EBF743F85; Mon, 24 Mar 2003 09:07:22 -0800 (PST) (envelope-from nectar@celabo.org) Received: from madman.celabo.org (madman.celabo.org [10.0.1.111]) by gw.nectar.cc (Postfix) with ESMTP id DE38669; Mon, 24 Mar 2003 11:07:21 -0600 (CST) Received: by madman.celabo.org (Postfix, from userid 1001) id CA20F78C43; Mon, 24 Mar 2003 11:07:21 -0600 (CST) Date: Mon, 24 Mar 2003 11:07:21 -0600 From: "Jacques A. Vidrine" To: Martin Blapp Cc: Martin Blapp , src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/contrib/isc-dhcp/client dhclient.c Message-ID: <20030324170721.GD1911@madman.celabo.org> References: <200303232329.h2NNTaI5089971@repoman.freebsd.org> <20030324160604.GB1911@madman.celabo.org> <20030324170856.O21003@cvs.imp.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030324170856.O21003@cvs.imp.ch> X-Url: http://www.celabo.org/ User-Agent: Mutt/1.5.3i-ja.1 X-Spam-Status: No, hits=-32.2 required=5.0 tests=AWL,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, QUOTE_TWICE_1,REFERENCES,REPLY_WITH_QUOTES,USER_AGENT_MUTT autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, Mar 24, 2003 at 05:35:49PM +0100, Martin Blapp wrote: > > Hi, > > > Are you sure that all values of pid_t can be represented in a signed > > int? > > sys/alpha/include/ansi.h:#define _BSD_PID_T_ int /* process [group] */ > sys/i386/include/ansi.h:#define _BSD_PID_T_ int /* process [group] */ > sys/sys/types.h:typedef _BSD_PID_T_ pid_t; /* process id */ So we hope that never changes? :-) On -CURRENT, apparently pid_t is always int32_t. But, %d is `int' and I'm not sure that `int' is always 32 bits and will be forever. > > + pid_t oldpid; > > ! e = fscanf(pidfd, "%d", &oldpid); > > > > I'd probably opt to do the fscanf with an unsigned long, and then cast > > the value to (pid_t). *shrug* > > or use a unsigned int for it ? Will we have to change this for later ? Why int rather than long? When doing I/O, use the widest standard types available and then see if the result fits in your target. (Don't ask me how to check the range in portable way :-) Cheers, -- Jacques A. Vidrine http://www.celabo.org/ NTT/Verio SME . FreeBSD UNIX . Heimdal Kerberos jvidrine@verio.net . nectar@FreeBSD.org . nectar@kth.se To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message