From owner-freebsd-stable@FreeBSD.ORG Thu Feb 12 01:13:43 2015 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C0F28D25 for ; Thu, 12 Feb 2015 01:13:43 +0000 (UTC) Received: from alogt.com (alogt.com [69.36.191.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 984FCA86 for ; Thu, 12 Feb 2015 01:13:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=alogt.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=KMQ2Ff57wXaq5+OEHIogZ/0QtGOKABA6M+sqXI9Lhzw=; b=xEZKGk6ebOqjayeg2x/W51l17koVE6iPVOR5luKZkAwW0U07uxH0d90l1r5+eEwGxbpY6KGOMEASKzPiIKv8BcOmai47Mtkees95dsLlBesyM1hZUckHkBWeFsre5wlYMO6mDBI9p7VedaXxMBfk76lKUCaXFKn3g488Mfj9l8c=; Received: from [114.124.26.148] (port=19029 helo=B85M-HD3-0.alogt.com) by sl-508-2.slc.westdc.net with esmtpsa (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.84) (envelope-from ) id 1YLiLX-001s23-4k; Wed, 11 Feb 2015 18:13:36 -0700 Date: Thu, 12 Feb 2015 09:13:23 +0800 From: Erich Dollansky To: Bob Willcox Subject: Re: top, fixed buffer length in utils.c Message-ID: <20150212091323.245485ba@B85M-HD3-0.alogt.com> In-Reply-To: <20150210231440.GB471@rancor.immure.com> References: <20150201175159.7fa88d16@B85M-HD3-0.alogt.com> <20150203003307.GG27103@funkthat.com> <20150210231440.GB471@rancor.immure.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - sl-508-2.slc.westdc.net X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - alogt.com X-Get-Message-Sender-Via: sl-508-2.slc.westdc.net: authenticated_id: erichsfreebsdlist@alogt.com X-Source: X-Source-Args: X-Source-Dir: Cc: John-Mark Gurney , freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2015 01:13:43 -0000 Hi, On Tue, 10 Feb 2015 17:14:41 -0600 Bob Willcox wrote: > On Mon, Feb 02, 2015 at 04:33:07PM -0800, John-Mark Gurney wrote: > > Erich Dollansky wrote this message on Sun, Feb 01, 2015 at 17:51 > > +0800: > > > int can be 64 bits on a amd64 machine. Why is the author of this > > > code so sure that we will never cross the 32 bit boundary? > > > > Per others, int is currently 32bits on all platforms we support... > > > > I guess adding: > > CTASSERT(sizeof(int) <= 4); > > > > would help fix your concern? at least now the expectation is > > codified and if it breaks, the build will break.. > > > > -- > > John-Mark Gurney Voice: +1 415 225 > > 5579 > > > > If/when the size of an int ever changes from being 32 bits, top will > be the least of our worries! > if all dubious statements have asserts in place, nothing will be a worry until then. It is a very bad idea to assume a size for any type when the size can change between compilers. If you want, just read the old discussion regarding time_t. Erich