Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1IFpLn-0007xk-Gi for mharc-grub-devel@gnu.org; Tue, 31 Jul 2007 06:53:15 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IFpLk-0007wz-5T for grub-devel@gnu.org; Tue, 31 Jul 2007 06:53:12 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IFpLi-0007wb-Ji for grub-devel@gnu.org; Tue, 31 Jul 2007 06:53:11 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IFpLi-0007wW-E9 for grub-devel@gnu.org; Tue, 31 Jul 2007 06:53:10 -0400 Received: from smtp-vbr6.xs4all.nl ([194.109.24.26]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IFpLh-0008SG-T5 for grub-devel@gnu.org; Tue, 31 Jul 2007 06:53:10 -0400 Received: from localhost.localdomain (249-174.surfsnel.dsl.internl.net [145.99.174.249]) by smtp-vbr6.xs4all.nl (8.13.8/8.13.8) with ESMTP id l6VAr8pL064041 for ; Tue, 31 Jul 2007 12:53:09 +0200 (CEST) (envelope-from mgerards@xs4all.nl) From: Marco Gerards To: The development of GRUB 2 References: Mail-Copies-To: mgerards@xs4all.nl Date: Tue, 31 Jul 2007 12:55:05 +0200 In-Reply-To: (bean123ch@gmail.com's message of "Tue, 31 Jul 2007 16:29:28 +0800") Message-ID: <87y7gwg7w6.fsf@xs4all.nl> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by XS4ALL Virus Scanner X-detected-kernel: FreeBSD 4.6-4.9 Subject: Re: Problem with the blocklist command 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: Tue, 31 Jul 2007 10:53:12 -0000 Bean writes: Hi Bean, > I notice that the output of blocklist command is quite strange. After > some debuging, I think > the problem may be caused by the compiler. [...] > I blocklist a very small file, it shows > 1- 32 > 2- 32 > 3- 17294103305076670291 > > If I define part_start as a global variable, the ouput is ok. > > I don't know if this is a compiler related bug, my gcc version is > > gcc version 4.1.2 20061028 (prerelease) (Debian 4.1.1-19) This is most likely the regparam bug. I wrote a macro to work around this bug (NESTED_FUNC_ATTR). See, for example, how this is used in fshelp.[ch]. Most likely the same has to be done for the read_hook. When you do this, the problem will disappear. I could fix this for you, if you do not exactly understand what I mean... We should at some point check if other hooks have the same problem. > btw, I'm curious to know how local variable part_start is passed to > hook function > read_blocklist. It isn't. The hook function is a nested function, it can access all local variables of grub_cmd_blocklist. -- Marco