From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NHmLd-00005b-FJ for mharc-grub-devel@gnu.org; Mon, 07 Dec 2009 17:46:29 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHmLb-0008Ud-CK for grub-devel@gnu.org; Mon, 07 Dec 2009 17:46:27 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHmLW-0008Oe-G5 for grub-devel@gnu.org; Mon, 07 Dec 2009 17:46:26 -0500 Received: from [199.232.76.173] (port=36582 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHmLW-0008OP-BH for grub-devel@gnu.org; Mon, 07 Dec 2009 17:46:22 -0500 Received: from 197.red-80-32-81.staticip.rima-tde.net ([80.32.81.197]:57724 helo=mail.pina.cat) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHmLV-0006Ns-Qu for grub-devel@gnu.org; Mon, 07 Dec 2009 17:46:22 -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 5538F28415526 for ; Mon, 7 Dec 2009 23:46:20 +0100 (CET) Received: by pinux (Postfix, from userid 1000) id E974D156A1; Mon, 7 Dec 2009 22:46:30 +0000 (GMT) Date: Mon, 7 Dec 2009 22:46:30 +0000 From: Carles Pina i Estany To: The development of GNU GRUB Message-ID: <20091207224630.GA31855@pina.cat> References: <20091207140923.GA6439@riva.ucam.org> <20091207201408.GA27276@pina.cat> <20091207205420.GI6439@riva.ucam.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091207205420.GI6439@riva.ucam.org> 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 22:46:27 -0000 Hi, On Dec/07/2009, Colin Watson wrote: > On Mon, Dec 07, 2009 at 08:14:08PM +0000, Carles Pina i Estany wrote: > > a) It's a bit of false security because it's not fixing the case of file > > normal/menu_text.c, line 191 (search the string "Use the %C and %C keys > > to") or menu_text.c line 374 (search for "The highlighted entry") > > (I agree that it's better than before... but not very solid) > > Forget security, in this case; let's just think of it as a way to avoid Ok, I'll forget about security (even when the name is not helping to forget about security :-) ) > > b) How would you translate and handle: > > grub_printf (_("Hello %s"), name); > > -Wformat-security doesn't interfere with that. As its documentation > says: > > At present, this warns about calls to `printf' and `scanf' functions > where the format string is not a string literal and there are no > format arguments, as in `printf (foo);'. I see now (not before) > > Using any different number of %X from msgid and msgstr ishalting > > msgfmt (so, if msgid contains 1 %s and 2 %d, msgstr > > has to contain the same) > > That only works for strings with the "c-format" attribute, which > xgettext only applies (and should only apply) to msgids that contain > "%". It helps for the string you mentioned earlier with %C in the msgid, right. Actually I was expecting that all strings in a C file would has c-format, but it's not the case: ---- #: normal/menu_entry.c:840 #, c-format msgid "Possible %s are:" #: normal/menu_entry.c:1003 msgid "Booting a command list" ---- And confirmed: if the translator adds %C in the second string ("Booting a command list") msgfmt -c is not complaining. So I would apply your patch, after understanding that it's only for strings that doesn't have any %C (and in my opinion xgettext could add the c-format if it's in a C file, but we will not discuss it here now :-) , I guess that in some cases would not be correct) Your patch conflicts with my one (Subject: gettext: grub_printf_ and N_) but it's not a big problem. If you commit before I would adapt my one, else I would adapt your one. -- Carles Pina i Estany http://pinux.info