MacOS generates warnings for g_size_checked_mul()
I was looking into enabling -Werror
builds on MacOS, but a recent GTK CI run had this complaint:
[2739/3896] Compiling C object gtk/libgtk.a.p/gtkcomposetable.c.o
../gtk/gtkcomposetable.c:641:28: warning: incompatible pointer types passing 'gsize *' (aka 'unsigned long *') to parameter of type 'guint64 *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
if (!g_size_checked_mul (&length, n_index_stride, n_seqs))
^~~~~~~
../subprojects/glib/glib/gtypes.h:446:27: note: expanded from macro 'g_size_checked_mul'
_GLIB_CHECKED_MUL_U64(dest, a, b)
^~~~
../subprojects/glib/glib/gtypes.h:465:56: note: passing argument to parameter 'dest' here
static inline gboolean _GLIB_CHECKED_MUL_U64 (guint64 *dest, guint64 a, guint64 b) {
^
1 warning generated.
I checked the source and the length variable is indeed a gsize
.
It seems glib confuses unsigned long long
and unsigned long
on MacOS somehow when dealing with gsize
and guint64
?