From owner-freebsd-arch@FreeBSD.ORG Mon Jan 31 16:54:49 2005 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4C68E16A4CE for ; Mon, 31 Jan 2005 16:54:49 +0000 (GMT) Received: from mx1.originative.co.uk (freebsd.gotadsl.co.uk [81.6.249.198]) by mx1.FreeBSD.org (Postfix) with ESMTP id BEF4843D1F for ; Mon, 31 Jan 2005 16:54:46 +0000 (GMT) (envelope-from paul@mx1.originative.co.uk) Received: from localhost (unknown [127.0.0.1]) by mx1.originative.co.uk (Postfix) with ESMTP id BBE7015575 for ; Mon, 31 Jan 2005 16:54:45 +0000 (GMT) Received: from mx1.originative.co.uk ([127.0.0.1])port 10024) with ESMTP id 50504-10 for ; Mon, 31 Jan 2005 16:54:30 +0000 (GMT) Received: by mx1.originative.co.uk (Postfix, from userid 1000) id DD47715579; Mon, 31 Jan 2005 16:54:29 +0000 (GMT) Date: Mon, 31 Jan 2005 16:54:29 +0000 From: Paul Richards To: arch@FreeBSD.ORG Message-ID: <20050131165429.GU61409@myrddin.originative.co.uk> References: <20050128173327.GI61409@myrddin.originative.co.uk> <20050131102630.GJ61409@myrddin.originative.co.uk> <20050131164157.GA11469@VARK.MIT.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050131164157.GA11469@VARK.MIT.EDU> User-Agent: Mutt/1.5.6i Subject: Re: c99/c++ localised variable definition X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jan 2005 16:54:49 -0000 On Mon, Jan 31, 2005 at 11:41:57AM -0500, David Schultz wrote: > On Mon, Jan 31, 2005, Paul Richards wrote: > > Ok, to sum up the discussion then: > > > > 1) In the kernel the issue of stack usage is a relevant consideration > > against adopting the new style. > > Is it? In my experience, gcc 3.X does a proper liveness analysis > at -O1 and higher, and reuses stack space pretty well. This is an > elementary optimization. (Some people don't seem to trust the > compiler to do this, so they do evil things such as reuse an > identifier to mean two different things in the same function.) It's more a question of the programmer being able to do a quick visual check i.e. it's easy to spot bad practice say creating a large array on the stack, if it's all there in one place. If it's spread throughout the file then you might not spot that erroneous line. I think tools would be better used here than code style but I can see the point of the argument. -- Paul Richards