From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KzdXm-0000d1-Oc for mharc-grub-devel@gnu.org; Mon, 10 Nov 2008 15:39:30 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KzdXk-0000at-OG for grub-devel@gnu.org; Mon, 10 Nov 2008 15:39:28 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KzdXi-0000Zx-H2 for grub-devel@gnu.org; Mon, 10 Nov 2008 15:39:27 -0500 Received: from [199.232.76.173] (port=59996 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KzdXi-0000Zt-AT for grub-devel@gnu.org; Mon, 10 Nov 2008 15:39:26 -0500 Received: from mailout09.t-online.de ([194.25.134.84]:47703) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KzdXh-00041k-WC for grub-devel@gnu.org; Mon, 10 Nov 2008 15:39:26 -0500 Received: from fwd01.aul.t-online.de by mailout09.sul.t-online.de with smtp id 1KzdXf-0000Od-02; Mon, 10 Nov 2008 21:39:23 +0100 Received: from [10.3.2.2] (Vml3h4Zarh+47iXArS5ODa6fl+S+72Xn8qCbNJFoNT2db9ygoyofhZ9z1XMraJfQnh@[217.235.223.95]) by fwd01.aul.t-online.de with esmtp id 1KzdXR-0aynmy0; Mon, 10 Nov 2008 21:39:09 +0100 Message-ID: <49189BED.1050501@t-online.de> Date: Mon, 10 Nov 2008 21:39:09 +0100 From: Christian Franke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 SeaMonkey/1.1.11 MIME-Version: 1.0 To: The development of GRUB 2 References: <20081101190204.GB4639@thorin> <49109AB8.4010509@nic.fi> <20081104190751.GA25519@thorin> <49109EE7.6050406@nic.fi> <20081104193911.GA26419@thorin> <491143E2.4040705@t-online.de> <20081105094240.GA12201@thorin> <49121300.2050506@t-online.de> <20081106145252.GA24460@thorin> <49135D60.5080400@t-online.de> <20081107190218.GA8625@thorin> In-Reply-To: <20081107190218.GA8625@thorin> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ID: Vml3h4Zarh+47iXArS5ODa6fl+S+72Xn8qCbNJFoNT2db9ygoyofhZ9z1XMraJfQnh X-TOI-MSGID: 3bf081d2-d878-49b8-8f4c-48172e765678 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: __FILE__ (Re: [PATCH] framework for building modules externally) 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: Mon, 10 Nov 2008 20:39:29 -0000 Robert Millan wrote: > On Thu, Nov 06, 2008 at 10:10:56PM +0100, Christian Franke wrote: > >> See attached patch for a possible fix: Each module using grub_dprintf >> (here disk.c) may specify its name in 'this_file'. When all modules are >> changed, the '#define this_file' and all #undefs can be removed. >> > > This adds redundancy which later makes it more work to move code around and > rename files, etc. Why not make it part of the build system? I.e. to build > foo.c, you need gcc -Dfile=foo.c foo.c ? > > Rarely used, but makes sense. Even leaving the source as is and using 'gcc -D__FILE__=foo.c ...' would work, but then gcc emits a warning. > But then again, since gcc is free software perhaps it'd make more sense to > add new candy there? (e.g. __RELATIVE_FILE__ or so). > > ... and/or a new option '-ffile_var_relative_to=PREFIX' which removes PREFIX (e.g. "$srcdir/") from __FILE__ expansions. Then such a fix could easily be added also to other existing projects, without any sourcecode changes. Christian