Re: Warnings compiling with glib svn trunk



El mié, 14-05-2008 a las 11:37 +0100, Emmanuele Bassi escribió:
> On Wed, 2008-05-14 at 12:25 +0200, Carlos Garcia Campos wrote:
> > This change in glib:
> > 
> > http://svn.gnome.org/viewvc/glib/trunk/glib/gi18n.h?r1=6713&r2=6882
> > 
> > changes the prototype of _() returning now a const char *. This produces
> > a lot of warnings  in some programs. I've just noticed it compiling
> > nautilus from svn trunk which seems to have the Werror flag active by
> > default.
> 
> _() always returned a const gchar*, be it when it was expanding to
> gettext() (which returns a const char*) or when it expanded to the
> string it contained.

According to the gettext man page:

#include <libintl.h>

char * gettext (const char * msgid);

> applications keeping/modifying the string returned by _() around without
> copying it first have always been broken and should be fixed.

yes, because the result is a a statically allocated string. 

> ciao,
>  Emmanuele.

-- 
Carlos Garcia Campos
   elkalmail yahoo es
   carlosgc gnome org
   http://carlosgc.linups.org
PGP key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x523E6462

Attachment: signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente



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