2.75.3: g_string_append_len_inline: error: implicit conversion changes signedness
Our dnf5 build on fedora rawhide with clang started failing after glib upgrade with:
In file included from /builddir/build/BUILD/dnf5-5.0.6-0.20230214173324.5.0.5+48.g760f20c9/libdnf/logger/glib_log_handler.cpp:22:
In file included from /usr/include/glib-2.0/glib.h:56:
In file included from /usr/include/glib-2.0/glib/giochannel.h:36:
/usr/include/glib-2.0/glib/gstring.h:217:11: error: implicit conversion changes signedness: 'size_t' (aka 'unsigned long') to 'gssize' (aka 'long') [-Werror,-Wsign-conversion]
len = strlen (val);
~ ^~~~~~~~~~~~
/usr/include/glib-2.0/glib/gstring.h:219:32: error: implicit conversion changes signedness: 'gssize' (aka 'long') to 'unsigned long' [-Werror,-Wsign-conversion]
if (G_LIKELY (gstring->len + len < gstring->allocated_len))
~ ^~~
/usr/include/glib-2.0/glib/gmacros.h:1245:59: note: expanded from macro 'G_LIKELY'
#define G_LIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR(expr), 1))
^~~~
/usr/include/glib-2.0/glib/gmacros.h:1244:66: note: expanded from macro '_G_BOOLEAN_EXPR'
#define _G_BOOLEAN_EXPR(expr) _G_BOOLEAN_EXPR_IMPL (__COUNTER__, expr)
^~~~
/usr/include/glib-2.0/glib/gmacros.h:1238:8: note: expanded from macro '_G_BOOLEAN_EXPR_IMPL'
if (expr) \
^~~~
In file included from /builddir/build/BUILD/dnf5-5.0.6-0.20230214173324.5.0.5+48.g760f20c9/libdnf/logger/glib_log_handler.cpp:22:
In file included from /usr/include/glib-2.0/glib.h:56:
In file included from /usr/include/glib-2.0/glib/giochannel.h:36:
/usr/include/glib-2.0/glib/gstring.h:223:27: error: implicit conversion changes signedness: 'gssize' (aka 'long') to 'size_t' (aka 'unsigned long') [-Werror,-Wsign-conversion]
memcpy (end, val, len);
~~~~~~ ^~~
/usr/include/glib-2.0/glib/gstring.h:225:28: error: implicit conversion changes signedness: 'gssize' (aka 'long') to 'size_t' (aka 'unsigned long') [-Werror,-Wsign-conversion]
memmove (end, val, len);
~~~~~~~ ^~~
/usr/include/glib-2.0/glib/gstring.h:226:23: error: implicit conversion changes signedness: 'gssize' (aka 'long') to 'unsigned long' [-Werror,-Wsign-conversion]
gstring->len += len;
~~ ^~~
5 errors generated.
I believe this is an issue introduce by: !3199 (merged)