moved GFunc cast to macro GFUNC_COMPAT_CAST
[pspp] / src / ui / gui / helper.h
index c1d93a8c033dbc5db277a74e9a109251a2bbd654..8d18fcf4b44e4b318d5bb29eb4686f389d77afa7 100644 (file)
@@ -65,5 +65,13 @@ psppire_box_pack_start_defaults (GtkBox *box, GtkWidget *widget)
   gtk_box_pack_start (box, widget, TRUE, TRUE, 0);
 }
 
+/* Starting with gcc8 the warning Wcast-function-type will
+   trigger if no intermediate (void (*)(void)) cast is done
+   for a function cast to GFunc when the number of parameters
+   is not 2. The reason is that the compiler behaviour in this
+   situation is undefined according to C standard although many
+   implementations rely on this. */
+#define GFUNC_COMPAT_CAST(x) ((GFunc) (void (*)(void)) (x))
+
 #endif