g_str_equal switched to stricter API (typing)
I'm just distro person and C developer, not a direct glib user, but !2940 (merged) looks like API-breaking change to me. In docs you still write that the parameters are gconstpointer
, but in the macro they're effectively const char *
. Consequently, some packages using -Werror
got broken by this, too.
Practical regression examples leading to failed builds, as requested:
../libvirt-gconfig/libvirt-gconfig-domain-capabilities-os.c: In function 'search_firmwares':
../libvirt-gconfig/libvirt-gconfig-domain-capabilities-os.c:70:26: warning: pointer targets in passing argument 1 of 'strcmp' differ in signedness [-Wpointer-sign]
70 | if (!g_str_equal(node->name, "enum"))
glib-2.74.1-dev/include/glib-2.0/glib/ghash.h:165:39: note: in definition of macro 'g_str_equal'
165 | #define g_str_equal(v1, v2) (strcmp ((v1), (v2)) == 0)
| ^~
src/libpriv/rpmostree-util.cxx: In function 'gboolean rpmostree_str_ptrarray_contains(GPtrArray*, const char*)':
src/libpriv/rpmostree-util.cxx:439:42: error: invalid conversion from 'gpointer' {aka 'void*'} to 'const char*' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-fpermissive-fpermissive8;;]
439 | if (g_str_equal (str, strs->pdata[i]))
glib-2.74.1-dev/include/glib-2.0/glib/ghash.h:165:45: note: in definition of macro 'g_str_equal'
165 | #define g_str_equal(v1, v2) (strcmp ((v1), (v2)) == 0)
| ^~
(Yes, I do know that the errors are easy to work around in each respective package.)