Re: Build failures on Ubuntu due to gettext

2009-12-10 Thread Carles Pina i Estany
Hi, On Dec/10/2009, Robert Millan wrote: On Tue, Dec 08, 2009 at 12:10:34AM +, Colin Watson wrote: Even if we're only discussing a change in five places, I assume we're going to find this situation in lots of calls throurough GRUB code. If this is so, it really calls for a solution that

Re: Build failures on Ubuntu due to gettext

2009-12-09 Thread Carles Pina i Estany
Hi Vladimir, Colin, On Dec/08/2009, Vladimir '??-coder/phcoder' Serbinenko wrote: My patch made the following transformation: - grub_printf (_(literal string)); + grub_printf (%s, _(literal string)); This was only necessary in five places, so I doubt that a function is worth it.

Re: Build failures on Ubuntu due to gettext

2009-12-09 Thread Carles Pina i Estany
Hi, As Vladimir spotted: On Dec/09/2009, Carles Pina i Estany wrote: This...: +#define grub_put_(str) grub_printf(%s, (str)) should be: #define grub_put_(str) grub_printf(N_ (%s), (str)) If you Colin commit it don't propagate my mistake. -- Carles Pina i Estany

Re: Build failures on Ubuntu due to gettext

2009-12-09 Thread Carles Pina i Estany
Hi, On Dec/10/2009, Carles Pina i Estany wrote: As Richard commented (thanks): #define grub_put_(str) grub_printf(N_ (%s), (str)) #define grub_put_(str) grub_printf(%s, N (str)) I should not be sending patches when too tired / without properly testing with the .po

Re: Build failures on Ubuntu due to gettext

2009-12-09 Thread Robert Millan
On Tue, Dec 08, 2009 at 12:10:34AM +, Colin Watson wrote: My patch made the following transformation: - grub_printf (_(literal string)); + grub_printf (%s, _(literal string)); This was only necessary in five places, so I doubt that a function is worth it. I think we all agree

Build failures on Ubuntu due to gettext

2009-12-07 Thread Colin Watson
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

Re: Build failures on Ubuntu due to gettext

2009-12-07 Thread Carles Pina i Estany
Hello, On Dec/07/2009, 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)); I see... (actually some weeks ago I thought about gettext security implications, and I thought

Re: Build failures on Ubuntu due to gettext

2009-12-07 Thread Colin Watson
On Mon, Dec 07, 2009 at 08:14:08PM +, Carles Pina i Estany wrote: On Dec/07/2009, 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)); I see... (actually some weeks

Re: Build failures on Ubuntu due to gettext

2009-12-07 Thread Vladimir 'φ-coder/phcoder' Serbinenko
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

Re: Build failures on Ubuntu due to gettext

2009-12-07 Thread Carles Pina i Estany
Hi, On Dec/07/2009, Colin Watson wrote: On Mon, Dec 07, 2009 at 08:14:08PM +, 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

Re: Build failures on Ubuntu due to gettext

2009-12-07 Thread Colin Watson
On Mon, Dec 07, 2009 at 11:04:52PM +0100, 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

Re: Build failures on Ubuntu due to gettext

2009-12-07 Thread Carles Pina i Estany
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

Re: Build failures on Ubuntu due to gettext

2009-12-07 Thread Vladimir 'φ-coder/phcoder' Serbinenko
Carles Pina i Estany wrote: 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

Re: Build failures on Ubuntu due to gettext

2009-12-07 Thread Carles Pina i Estany
Hi, On Dec/07/2009, Carles Pina i Estany wrote: So I would apply your patch, after understanding that it's only for one more thing Colin. What do you think to not apply your patch and apply the attached patch? It force that the argument 1 of _ and N_ is a c-format (in this way appears in

Re: Build failures on Ubuntu due to gettext

2009-12-07 Thread Colin Watson
Furthermore, the style I suggested is used in many other GNU projects. Here are just a few examples: coreutils/src/du.c:994: error (0, 0, %s, _(invalid zero-length file name)); diffutils/src/sdiff.c:853: fprintf (stderr, %s, _(\ diffutils/src/sdiff.c-854-ed:\tEdit then use both

Re: Build failures on Ubuntu due to gettext

2009-12-07 Thread Colin Watson
On Tue, Dec 08, 2009 at 12:25:01AM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: Your N_ patch superseeds Colin's patch. Feel free to use printf_ where necessary. It solves format-security problems It only works around the compiler warning if functions have not been given the correct

Re: Build failures on Ubuntu due to gettext

2009-12-07 Thread Colin Watson
On Mon, Dec 07, 2009 at 11:38:04PM +, Carles Pina i Estany wrote: On Dec/07/2009, Carles Pina i Estany wrote: So I would apply your patch, after understanding that it's only for one more thing Colin. What do you think to not apply your patch and apply the attached patch? It force

Re: Build failures on Ubuntu due to gettext

2009-12-07 Thread Vladimir 'φ-coder/phcoder' Serbinenko
Colin Watson wrote: Furthermore, the style I suggested is used in many other GNU projects. Here are just a few examples: coreutils/src/du.c:994: error (0, 0, %s, _(invalid zero-length file name)); diffutils/src/sdiff.c:853: fprintf (stderr, %s, _(\

Re: Build failures on Ubuntu due to gettext

2009-12-07 Thread Colin Watson
On Mon, Dec 07, 2009 at 10:46:30PM +, Carles Pina i Estany wrote: 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. Please go ahead with your patch after due

Re: Build failures on Ubuntu due to gettext

2009-12-07 Thread Colin Watson
On Tue, Dec 08, 2009 at 12:59:28AM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: Colin Watson wrote: Furthermore, the style I suggested is used in many other GNU projects. Here are just a few examples: coreutils/src/du.c:994: error (0, 0, %s, _(invalid zero-length file

Re: Build failures on Ubuntu due to gettext

2009-12-07 Thread Carles Pina i Estany
Hi, On Dec/08/2009, Colin Watson wrote: On Mon, Dec 07, 2009 at 10:46:30PM +, Carles Pina i Estany wrote: 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.

Re: Build failures on Ubuntu due to gettext

2009-12-07 Thread Vladimir 'φ-coder/phcoder' Serbinenko
Colin Watson wrote: What on earth?! I said nothing of the kind! That would obviously be completely insane. Sorry for having misunderstood you. How did you arrive at that impression? Extrapolation of proposed changes since a lot of patches in gettext threads were samples. My patch made the