Re: Compile warning when setting entry text



gtk uk2 net wrote:
> In my application, on a form, the first entry has to be calculated (next
> available transaction number), but it has to be an entry because it can
> eventually be modified by the user, defaulting to the calculated value.
> 
> Setting the default with
> 
> gtk_entry_set_text(GTK_ENTRY(entry), nextavailnumber() );
> 
> gives me the following warning at compile time:
> 
> passing arg 2 of `gtk_entry_set_text' makes pointer from integer without
> a cast.
> 
> I have extern *nextavailnumber() defined returning a character from a
> database.
> 
> I tried returning pointers instead of characters from the external
> functions, the message is different, but there is still a warning.

Hi Henry, sounds like you need:

	extern const char *nextavailablenumber();

Otherwise it'll default to int, and cause the warning you're seeing.

John




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