From owner-freebsd-stable@FreeBSD.ORG Tue Feb 3 12:01:54 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 B1DD3D84 for ; Tue, 3 Feb 2015 12:01:54 +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 8B6516E for ; Tue, 3 Feb 2015 12:01:54 +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=xwE3sZD8NSkw80NY9Be9ZbHChAWRzM3jvyJRTLNpJTo=; b=rH4GfxiXhD+aKUNtVcBs3Si6zOf7LpRL2G1uSDkzFIJoVIIv2eTZ+sF5luPfoBxHPCTR37yWcXqsM7tU+LgMny03AYEHsIhxjha3j+fh8N3dF0iGMvcBi1x0J6kIHU1WmIEm4BboE7Qw2/+tmMtkMDwsjdbs17rwxJA+dBR2CA0=; Received: from [39.251.139.188] (port=64298 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 1YIcAs-001vCt-Sm; Tue, 03 Feb 2015 05:01:47 -0700 Date: Tue, 3 Feb 2015 20:01:35 +0800 From: Erich Dollansky To: John-Mark Gurney Subject: Re: top, fixed buffer length in utils.c Message-ID: <20150203200135.57c8c236@B85M-HD3-0.alogt.com> In-Reply-To: <20150203003307.GG27103@funkthat.com> References: <20150201175159.7fa88d16@B85M-HD3-0.alogt.com> <20150203003307.GG27103@funkthat.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: 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: Tue, 03 Feb 2015 12:01:54 -0000 Hi, On Mon, 2 Feb 2015 16:33:07 -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.. > of course. Either avoid the run-time problem or get an error message and things cannot create hidden problem. Erich