Build failure with stricter C compilers (e.g. GCC 14)
Modern C compilers are becoming stricter with a variety of changes over the last year or so.
GCC 14 in particular (to be released in ~April 2024) fails to build xdg-desktop-portal-gnome-45.1 (and main at 15fda7e6) like:
../src/inputcapture.c: In function ‘create_input_capture_dialog’:
../src/inputcapture.c:412:46: error: passing argument 2 of ‘gtk_window_group_add_window’ from incompatible pointer type [-Wincompatible-pointer-types]
412 | gtk_window_group_add_window (window_group, dialog);
| ^~~~~~
| |
| GtkWidget * {aka struct _GtkWidget *}
In file included from /usr/include/gtk-4.0/gtk/gtk.h:302,
from ../src/inputcapturedialog.h:21,
from ../src/inputcapture.c:22:
/usr/include/gtk-4.0/gtk/gtkwindowgroup.h:71:70: note: expected ‘GtkWindow *’ {aka ‘struct _GtkWindow *’} but argument is of type ‘GtkWidget *’ {aka ‘struct _GtkWidget *’}
71 | GtkWindow *window);
| ~~~~~~~~~~~~~~~~~~~~^~~~~~
This can be emulated with -Werror=incompatible-pointer-types -Werror=implicit -Werror=int-conversion
on an older GCC or Clang.