
Has anyone else had difficulty building button.c since I made this change?
-----Forwarded Message----- From: MenTaLguY <mental@...3...> To: bulia byak <archiver_1@...19...> Subject: Re: button.c Date: Sun, 07 Dec 2003 19:07:50 -0500
On Sun, 2003-12-07 at 02:32, bulia byak wrote:
Mental, your latest button.c only compiles if I change
g_signal_handlers_block_by_func (G_OBJECT (button), G_CALLBACK (sp_button_perform_action), NULL); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), down); g_signal_handlers_unblock_by_func (G_OBJECT (button), G_CALLBACK (sp_button_perform_action), NULL);
by
g_signal_handlers_block_by_func (G_OBJECT (button), (void*) G_CALLBACK (sp_button_perform_action), NULL); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), down); g_signal_handlers_unblock_by_func (G_OBJECT (button), (void*) G_CALLBACK (sp_button_perform_action), NULL);
Is that the right fix?
No.
Casting a function pointer to a normal pointer isn't safe or portable -- you can get away with it on x86, but on many architectures (like e.g. Itanium), a function pointer is really a much larger "function descriptor" datatype.
Actually, this should compile as-is (it did compile for me), so it's something funky with one of our build configurations (not sure whose yet).
I'm using gcc 3.3.2 with CFLAGS="-g -Wall", and building with glib 2.2.3.
What compiler, compiler options, and version of GLib are you using, and what error(s) do you get when you try to compile?
-mental