From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NHlhb-0002qX-B6 for mharc-grub-devel@gnu.org; Mon, 07 Dec 2009 17:05:07 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHlhZ-0002pl-HO for grub-devel@gnu.org; Mon, 07 Dec 2009 17:05:05 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHlhV-0002n9-JI for grub-devel@gnu.org; Mon, 07 Dec 2009 17:05:05 -0500 Received: from [199.232.76.173] (port=60359 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHlhV-0002mm-89 for grub-devel@gnu.org; Mon, 07 Dec 2009 17:05:01 -0500 Received: from mail-ew0-f215.google.com ([209.85.219.215]:57009) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHlhU-0002tn-R8 for grub-devel@gnu.org; Mon, 07 Dec 2009 17:05:01 -0500 Received: by ewy7 with SMTP id 7so6349960ewy.32 for ; Mon, 07 Dec 2009 14:04:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type; bh=rCIDzib2OC37enUSvSHgvDxnRHuCNCFIgXwytbgT6KE=; b=UvXHNWLow/nbPxienRXpcBA/rq7HgRg0DpvJa0q2uRFdmD1CkHC7MIhJvfKccyhp0w dNkZ0BgUMWgbqLKmhyZLVI+T/Yyj5Ho8GuHstJdtLuDExuWnWcUox+gRTeQGTvzzJPog whslXe8Y/DIz2OMqSkBg9ykLFvCLrlNZvQsoE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; b=NgHjNlnetZxbY+OPvJQ/0d9MnB6XwlPL0+pWiu5Cgxlg3H9OkmPsoygJom3mpphj3o Q7HxVTDfUh5qI6ULTLOJW2CsAks8zbtO3NSqDPBA3uE/o0n6Z3xho9pcis4NByUoC/ti mdXMyVMKPuIwhYIhoUYNBAxIWouI5drQluR1g= Received: by 10.213.3.140 with SMTP id 12mr14976801ebn.20.1260223499573; Mon, 07 Dec 2009 14:04:59 -0800 (PST) Received: from debian.bg45.phnet (gprs01.swisscom-mobile.ch [193.247.250.1]) by mx.google.com with ESMTPS id 15sm3650598ewy.0.2009.12.07.14.04.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 07 Dec 2009 14:04:56 -0800 (PST) Message-ID: <4B1D7C04.1000503@gmail.com> Date: Mon, 07 Dec 2009 23:04:52 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20091109) MIME-Version: 1.0 To: The development of GNU GRUB References: <20091207140923.GA6439@riva.ucam.org> In-Reply-To: <20091207140923.GA6439@riva.ucam.org> X-Enigmail-Version: 0.95.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigFDC83574AA0E263B6C6F1663" X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:05:05 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigFDC83574AA0E263B6C6F1663 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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? > =20 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 > 2009-12-07 Colin Watson > > * normal/menu_entry.c (run): Don't pass the result of gettext as > the first argument to grub_printf, appeasing -Wformat-security. > (grub_menu_entry_run): Likewise. > * normal/menu_text.c (grub_wait_after_message): Likewise. > (print_message): Likewise. > (notify_execution_failure): Likewise. > > =3D=3D=3D modified file 'normal/menu_entry.c' > --- normal/menu_entry.c 2009-12-05 11:25:07 +0000 > +++ normal/menu_entry.c 2009-12-07 14:02:20 +0000 > @@ -1000,7 +1000,7 @@ run (struct screen *screen) > =20 > grub_cls (); > grub_printf (" "); > - grub_printf (_("Booting a command list")); > + grub_printf ("%s", _("Booting a command list")); > grub_printf ("\n\n"); > =20 > =20 > @@ -1182,6 +1182,6 @@ grub_menu_entry_run (grub_menu_entry_t e > grub_print_error (); > grub_errno =3D GRUB_ERR_NONE; > grub_putchar ('\n'); > - grub_printf (_("Press any key to continue...")); > + grub_printf ("%s", _("Press any key to continue...")); > (void) grub_getkey (); > } > > =3D=3D=3D modified file 'normal/menu_text.c' > --- normal/menu_text.c 2009-12-05 11:25:07 +0000 > +++ normal/menu_text.c 2009-12-07 14:02:45 +0000 > @@ -40,7 +40,7 @@ void > grub_wait_after_message (void) > { > grub_putchar ('\n'); > - grub_printf (_("Press any key to continue...")); > + grub_printf ("%s", _("Press any key to continue...")); > (void) grub_getkey (); > grub_putchar ('\n'); > } > @@ -206,7 +206,7 @@ entry is highlighted."); > if (nested) > { > grub_printf ("\n "); > - grub_printf (_("ESC to return previous menu.")); > + grub_printf ("%s", _("ESC to return previous menu.")); > } > } > } > @@ -655,7 +655,7 @@ notify_execution_failure (void *userdata > grub_errno =3D GRUB_ERR_NONE; > } > grub_printf ("\n "); > - grub_printf (_("Failed to boot default entries.\n")); > + grub_printf ("%s", _("Failed to boot default entries.\n")); > grub_wait_after_message (); > } > =20 > > Thanks, > > =20 --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enigFDC83574AA0E263B6C6F1663 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iF4EAREKAAYFAksdfAQACgkQNak7dOguQgnwDgD/WKM0oGU4rJvVARnK4inDciL3 dchgAj1UbttVQTSvzQIBALx0uijP7OKtLTHzmNOewH81b62yNIbxK61YDCLerVk0 =zIvW -----END PGP SIGNATURE----- --------------enigFDC83574AA0E263B6C6F1663--