Re: g_strdupv



On 10 Jun 2001 16:38:56 -0400, Havoc Pennington wrote:
> 
> Martin Baulig <martin home-of-linux org> writes:
> > 
> > is there a reason why g_strdupv() takes a `gchar **str_array'
> > and not a `const gchar **str_array' ?
> > 
> 
> All the gchar** in GTK/GLib are like that.
> 
> The reason is that C is stupid and will warn about passing "gchar**"
> to "const gchar**'.

Plus, in a perfectly const-correct world you'd want to declare

  gchar **g_strdupv(const gchar * const *strv);

but if people see that in your API, they get very unhappy. :-)

-JT





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