From owner-freebsd-arch@FreeBSD.ORG Fri Jan 28 20:10:50 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 1CBD716A4CE for ; Fri, 28 Jan 2005 20:10:50 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id A996143D2F for ; Fri, 28 Jan 2005 20:10:49 +0000 (GMT) (envelope-from peadar.edwards@gmail.com) Received: by wproxy.gmail.com with SMTP id 58so482227wri for ; Fri, 28 Jan 2005 12:10:49 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=R/MZ3JHek6ka8EIJV8kKK3ARygXiTyMfN/1Sx+mJXE6H7/rsWtnjKmkykoYiF2MIVHobFIDsEFc49l5tSCGfhTboNWI14K96AyhgEBbQ/1b6HqEldZ5aMGYeW28/S07ZVuTmiPRGbI+xWvCBPYfwScJb5UNFDqO7VIyGRh+9lq0= Received: by 10.54.28.75 with SMTP id b75mr59164wrb; Fri, 28 Jan 2005 12:10:49 -0800 (PST) Received: by 10.54.57.76 with HTTP; Fri, 28 Jan 2005 12:10:49 -0800 (PST) Message-ID: <34cb7c84050128121077633d22@mail.gmail.com> Date: Fri, 28 Jan 2005 20:10:49 +0000 From: Peter Edwards To: Paul Richards In-Reply-To: <20050128173327.GI61409@myrddin.originative.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <20050128173327.GI61409@myrddin.originative.co.uk> cc: arch@freebsd.org Subject: Re: c99/c++ localised variable definition X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Peter Edwards List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2005 20:10:50 -0000 > Personally, I find the c++/perl convention to be much less error prone > and more intuitive and since c99 now supports it too it seems the > standards body sees the benefits of this approach as well. I also, personally, like using this particular feature when writing userland code. However, in terms of kernel stuff, there's a practical reason for grouping definitions of local variables together: you can have a much better idea of how much stack space you are using when introducing a new definition when all other definitions are nearby. i.e., although a pleasing feature in terms of writing clean code in algorithmically, it can be quite a danger when dealing with a very limited stack.