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 gdl-3.40.0 like:
gdl-dock-item.c: In function ‘gdl_dock_item_class_init’:
gdl-dock-item.c:358:44: error: passing argument 1 of ‘gdl_dock_object_class_set_is_compound’ from incompatible pointer type [-Wincompatible-pointer-types]
358 | gdl_dock_object_class_set_is_compound (object_class, FALSE);
| ^~~~~~~~~~~~
| |
| GObjectClass * {aka struct _GObjectClass *}
In file included from gdl-dock.h:26,
from gdl-dock-item.c:38:
../gdl/gdl-dock-object.h:354:74: note: expected ‘GdlDockObjectClass *’ {aka ‘struct _GdlDockObjectClass *’} but argument is of type ‘GObjectClass *’ {aka ‘struct _GObjectClass *’}
354 | gdl_dock_object_class_set_is_compound (GdlDockObjectClass *object_class,
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
^
Originally reported downstream in Gentoo at https://bugs.gentoo.org/919197.
This can be emulated with -Werror=incompatible-pointer-types -Werror=implicit -Werror=int-conversion
on an older GCC or Clang.