Re: [gtk-list] gcc warning





On Fri, 5 Feb 1999, Marc wrote:

> gcc gives me the following warning :
> 
> warning: passing arg 4 of `gtk_signal_connect_after' makes pointer from
> integer without a cast
> 
> Here is the line involved :
> 
>   gtk_signal_connect_after ( GTK_OBJECT(menuitem), "toggled",
>                              GTK_SIGNAL_FUNC(my_function), (gint)TRUE);
> 
> but it says nothing for (a few lines below) : 
> 
>   gtk_signal_connect_after ( GTK_OBJECT(menuitem), "toggled",
>                              GTK_SIGNAL_FUNC(my_function), (gint)FALSE);

Zero, which is the value of FALSE, is a magic value like that.

In practice, you should _always_ cast integers to pointers, and pointers
to integers, with the Glib macros:

gtk_signal_connect_after ( GTK_OBJECT(menuitem), "toggled",
			   GTK_SIGNAL_FUNC(my_function),
			   GINT_TO_POINTER (TRUE) );

	Jeff






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