From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NHmq8-0000gW-Qm for mharc-grub-devel@gnu.org; Mon, 07 Dec 2009 18:18:00 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHmq7-0000dZ-3c for grub-devel@gnu.org; Mon, 07 Dec 2009 18:17:59 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHmq1-0000Sp-Dg for grub-devel@gnu.org; Mon, 07 Dec 2009 18:17:57 -0500 Received: from [199.232.76.173] (port=36401 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHmq0-0000Sb-S1 for grub-devel@gnu.org; Mon, 07 Dec 2009 18:17:52 -0500 Received: from 197.red-80-32-81.staticip.rima-tde.net ([80.32.81.197]:49782 helo=mail.pina.cat) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHmq0-00023i-Kg for grub-devel@gnu.org; Mon, 07 Dec 2009 18:17:52 -0500 Received: from pinux (82-45-164-87.cable.ubr06.hari.blueyonder.co.uk [82.45.164.87]) by mail.pina.cat (Postfix) with ESMTP id 6A60B28415527 for ; Tue, 8 Dec 2009 00:17:51 +0100 (CET) Received: by pinux (Postfix, from userid 1000) id 0ECABC907C; Mon, 7 Dec 2009 23:18:02 +0000 (GMT) Date: Mon, 7 Dec 2009 23:18:02 +0000 From: Carles Pina i Estany To: The development of GNU GRUB Message-ID: <20091207231802.GA7907@pina.cat> References: <20091207140923.GA6439@riva.ucam.org> <4B1D7C04.1000503@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B1D7C04.1000503@gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: Build failures on Ubuntu due to gettext X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 23:18:00 -0000 Hi, On Dec/07/2009, Vladimir '??-coder/phcoder' Serbinenko wrote: > Colin Watson wrote: > > Ubuntu's GCC enables -Wformat-security by default. This causes GCC to > > (IMO rightly!) complain about constructs such as this: > > > > grub_printf (_("foo")); > > > > ... because it's all too easy for a translator to (usually accidentally) > > insert % sequences which would cause printf to behave incorrectly. This > > should instead be: > > > > grub_printf ("%s", _("foo")); > > > > Patch follows. I can't help thinking that this would be easier with a > > grub_puts, but perhaps that isn't worth it given the relatively small > > number of occurrences here? > > > > Also, should the line in notify_execution_failure instead be: > > > > - grub_printf (_("Failed to boot default entries.\n")); > > + grub_printf ("%s\n", _("Failed to boot default entries.")); > > > > ... to get rid of the unsightly \n in this translated string? > > > This warning is simply wrong in this context. And silencing it is > against gettext manual. Read > http://www.gnu.org/software/hello/manual/gettext/Preparing-Strings.html > http://www.gnu.org/software/hello/manual/gettext/c_002dformat-Flag.html#c_002dformat-Flag other solution that I like even more (but I have a problem to implement): use --flag=_:1:pass-c-format . So all strings will be c-format and msgfmt will check the number of parameters (even if the string doesn't have %C, will be c-format and msgfmt should complain if msgstr has a new %C) -- Carles Pina i Estany http://pinux.info