Date: Mon, 31 Jan 2005 16:54:29 +0000 From: Paul Richards <paul@originative.co.uk> To: arch@FreeBSD.ORG Subject: Re: c99/c++ localised variable definition Message-ID: <20050131165429.GU61409@myrddin.originative.co.uk> In-Reply-To: <20050131164157.GA11469@VARK.MIT.EDU> References: <20050128173327.GI61409@myrddin.originative.co.uk> <20050131102630.GJ61409@myrddin.originative.co.uk> <20050131164157.GA11469@VARK.MIT.EDU>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050131165429.GU61409>