C warnings from gtk_menu_attach_to_widget binding (missing cast)
@alexl
Submitted by Alexander Larsson Link to original bug (#652553)
Description
Created attachment 189895 Test case
When i use gtk_menu_attach_to_widget (attached testcase) i get the following warnings:
$ valac --pkg=gtk+-3.0 src/test.vala /vcs/gnome/gnome-contacts/src/test.vala.c: In function ‘_test_menu_detach_gtk_menu_detach_func’: /vcs/gnome/gnome-contacts/src/test.vala.c:53:2: warning: passing argument 1 of ‘test_menu_detach’ from incompatible pointer type [enabled by default] /vcs/gnome/gnome-contacts/src/test.vala.c:46:13: note: expected ‘struct Test *’ but argument is of type ‘struct GtkWidget *’
The problem is that the callback type gets a widget, but the callback is on a widget subclass, so the pointer type is wrong and needs a downcast.
Attachment 189895, "Test case":
test.vala