From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KULIm-0002Ck-27 for mharc-grub-devel@gnu.org; Sat, 16 Aug 2008 08:54:40 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KULIj-0002Cf-QD for grub-devel@gnu.org; Sat, 16 Aug 2008 08:54:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KULIi-0002CT-SB for grub-devel@gnu.org; Sat, 16 Aug 2008 08:54:36 -0400 Received: from [199.232.76.173] (port=50142 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KULIi-0002CQ-NT for grub-devel@gnu.org; Sat, 16 Aug 2008 08:54:36 -0400 Received: from mta-out.inet.fi ([195.156.147.13]:38060 helo=jenni1.inet.fi) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KULIi-0003n6-6I for grub-devel@gnu.org; Sat, 16 Aug 2008 08:54:36 -0400 Received: from [127.0.0.1] (88.193.32.97) by jenni1.inet.fi (8.5.014) id 488F153400BB2103 for grub-devel@gnu.org; Sat, 16 Aug 2008 15:54:35 +0300 Message-ID: <48A6CE15.1030308@nic.fi> Date: Sat, 16 Aug 2008 15:54:45 +0300 From: =?UTF-8?B?VmVzYSBKw6TDpHNrZWzDpGluZW4=?= User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: The development of GRUB 2 References: <1218888325.4051.17.camel@fz.local> <48A6C8DC.3050303@nic.fi> <1218890593.5316.6.camel@fz.local> In-Reply-To: <1218890593.5316.6.camel@fz.local> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: Re: [RFC] Is it okay to just use GNU extensions or should an alternative be provided too? 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: Sat, 16 Aug 2008 12:54:38 -0000 Felix Zielcke wrote: > But yeah maybe there's even in the kernel a use for asprintf, > so maybe a good idea to make a grub_asprintf? > This could be then either always used even if the util/*.c use the > library functions normally or it could be done as with my > grub_print_error change :) It would be security feature to use automatic allocation of the memory for needed amount of the memory. Then it is not possible to do buffer overflow with those functions. So I have nothing against that. And in anyway it is only small wrapper to snprintf and malloc so size impact should not be too big either. Perhaps it can save space later on. But about using string formatters from different systems can be problematic. As on some systems differ what different specifiers do. Good examples are cases where string can be wide char or ansi, or where length of the integer can change. When using it with grub's own formatters we know exactly how they perform.