grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Build failures on Ubuntu due to gettext


From: Carles Pina i Estany
Subject: Re: Build failures on Ubuntu due to gettext
Date: Mon, 7 Dec 2009 23:18:02 +0000
User-agent: Mutt/1.5.20 (2009-06-14)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]