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 gdm-45.0.1 like:
FAILED: daemon/gdm.p/gdm-session.c.o
x86_64-pc-linux-gnu-gcc -Idaemon/gdm.p -Idaemon -I../gdm-45.0.1/daemon -I. -I../gdm-45.0.1 -Icommon -I../gdm-45.0.1/common -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/lib64/libffi/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -I/usr/include/accountsservice-1.0 -I/usr/include/polkit-1 -I/usr/include/gudev-1.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -D_GNU_SOURCE -O2 -pipe -march=native -fdiagnostics-color=always -pthread -MD -MQ daemon/gdm.p/gdm-session.c.o -MF daemon/gdm.p/gdm-session.c.o.d -o daemon/gdm.p/gdm-session.c.o -c ../gdm-45.0.1/daemon/gdm-session.c
../gdm-45.0.1/daemon/gdm-session.c: In function ‘free_pending_worker_connection’:
../gdm-45.0.1/daemon/gdm-session.c:3048:53: error: passing argument 1 of ‘g_dbus_interface_skeleton_unexport’ from incompatible pointer type [-Wincompatible-pointer-types]
3048 | g_dbus_interface_skeleton_unexport (worker_manager_interface);
| ^~~~~~~~~~~~~~~~~~~~~~~~
| |
| GdmDBusWorkerManager * {aka struct _GdmDBusWorkerManager *}
In file included from /usr/include/glib-2.0/gio/gio.h:58,
from ../gdm-45.0.1/daemon/gdm-session.c:44:
/usr/include/glib-2.0/gio/gdbusinterfaceskeleton.h:112:102: note: expected ‘GDBusInterfaceSkeleton *’ {aka ‘struct _GDBusInterfaceSkeleton *’} but argument is of type ‘GdmDBusWorkerManager *’ {aka ‘struct _GdmDBusWorkerManager *’}
112 | void g_dbus_interface_skeleton_unexport (GDBusInterfaceSkeleton *interface_);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
Originally reported downstream in Gentoo at https://bugs.gentoo.org/919081.
This can be emulated with -Werror=incompatible-pointer-types -Werror=implicit -Werror=int-conversion
on an older GCC or Clang.