From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Luw3j-0000cz-QE for mharc-grub-devel@gnu.org; Fri, 17 Apr 2009 17:57:19 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Luw3f-0000c3-9Z for grub-devel@gnu.org; Fri, 17 Apr 2009 17:57:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Luw3a-0000bA-Qr for grub-devel@gnu.org; Fri, 17 Apr 2009 17:57:15 -0400 Received: from [199.232.76.173] (port=51102 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Luw3a-0000b7-Mg for grub-devel@gnu.org; Fri, 17 Apr 2009 17:57:10 -0400 Received: from mailout11.t-online.de ([194.25.134.85]:55137) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Luw3a-00089P-1X for grub-devel@gnu.org; Fri, 17 Apr 2009 17:57:10 -0400 Received: from fwd02.aul.t-online.de by mailout11.sul.t-online.de with smtp id 1Luw3X-00023O-05; Fri, 17 Apr 2009 23:57:07 +0200 Received: from [10.3.2.2] (XNaYzgZZrhgM95Qh4lUX2VgnwCF5COluK-yeIYWjK5yXJru6qbvL2E4D+dLTY0pgwn@[217.235.220.245]) by fwd02.aul.t-online.de with esmtp id 1Luw3S-1vbivw0; Fri, 17 Apr 2009 23:57:02 +0200 Message-ID: <49E8FB2E.1080001@t-online.de> Date: Fri, 17 Apr 2009 23:57:02 +0200 From: Christian Franke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090403 SeaMonkey/1.1.16 MIME-Version: 1.0 To: The development of GRUB 2 References: <1239983697.4383.15.camel@mj> In-Reply-To: <1239983697.4383.15.camel@mj> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ID: XNaYzgZZrhgM95Qh4lUX2VgnwCF5COluK-yeIYWjK5yXJru6qbvL2E4D+dLTY0pgwn X-TOI-MSGID: 557237ed-01e9-442c-bd62-1002677e220d X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: Eliminating nested functions X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2009 21:57:15 -0000 Pavel Roskin wrote: > I suggest that we eliminate all nested functions. The reasons are: > > 1) They make the code less readable, as they make the parent functions > longer. > > 2) They have problems with some popular compilers, as recent as gcc-4.0 > when regparm(3) is used. > > 3) We failed to implement a reliable test for such problems. We are > using regparm(1) for all compilers. > > 4) The existing test is one of the obstacles making it impossible to > compile without having libc for the target (x86_64->i386 would be really > nice), as we need to run the compiled test executable. > > 5) Non-i386 architectures define NESTED_FUNC_ATTR as an empty symbol, so > developers on such architectures don't see if they use it correctly. > > 6) NESTED_FUNC_ATTR tends to proliferate to the file scope functions, as > it happened with grub_pci_iterate(). It only takes one caller using a > nested function to force NESTED_FUNC_ATTR on all functions used as an > argument to the same function. > > 7) The grub utils may not run on some 'security hardened' platform which does not allow to enable stack execution. -- Christian Franke