Re: g_list_foreach w/o user_data



Daniel Elstner <daniel elstner gmx net> writes:

> Hi,
> 
> I just saw this piece of code in GTK+ 1.3:
> 
>   g_list_foreach (info->icon_list,
>                   (GFunc) g_object_unref, NULL);
> 
> 
> This casts a 1-arg-function pointer to a 2-arg-function pointer.
> Doesn't that depend heavily on the compiler's function call model?
> How portable is it, actually?

Very, though ANSI C doesn't guarantee it. GTK+ depends on it all over
the place.

                                        Owen




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