Skip to content

glib/gvariant: fix compile error with GCC 14.0.1

Christian Hergert requested to merge wip/chergert/fix-gvariant-compile into main

This was erroring on recent GCC because struct heap_dict is smaller than the publicly provided size (guintptr[16]) in the header for GVariantDict.

../../../../Projects/glib/glib/gvariant.c: In function ‘g_variant_dict_new’:
../../../../Projects/glib/glib/gvariant.c:3981:8: warning: allocation of insufficient size ‘32’ for type ‘GVariantDict’ {aka ‘struct _GVariantDict’} with size ‘128’ [-Walloc-size]
 3981 |   dict = g_slice_alloc (sizeof (struct heap_dict));
      |        ^

Merge request reports