From mboxrd@z Thu Jan 1 00:00:00 1970 From: Timur Tabi Date: Wed, 08 Apr 2009 16:01:51 -0500 Subject: [U-Boot] use of C99 In-Reply-To: <49DD0E8A.904@freescale.com> References: <4A0B9AAA-4714-4C27-84A7-22FCE4D91DDA@freescale.com> <20090408192832.8D48F8560EFB@gemini.denx.de> <49DCFF1D.6080006@ge.com> <49DD0E8A.904@freescale.com> Message-ID: <49DD10BF.80002@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Scott Wood wrote: > It frees the variable up for later such blocks to use. As does > declaring iterators inside a for loop, but I guess that's forbidden as > well. :-) I'm not sure whether we want to allow the same variable to be defined more than once, even with the same type, inside a function. > Chances are it will allocate all stack space for all variables up front, > regardless of where they're declared. Yes, but it many cases it won't allocate any stack space at all because it will just keep the variable in a register. My point was that if a variable is defined later in a function, then it's more likely to have limited scope, so the compiler will be more likely to use a register instead of stack to store it. >> This is what we do today, and I think it's ugly. > > Yes. But not as ugly as having two #ifdef blocks. Agreed, but I don't consider it to be much of a compromise. -- Timur Tabi Linux kernel developer at Freescale