Skip to content

gunicode.h: fix warning with -Wcast-qual for define g_utf8_next_char()

Hannes Müller requested to merge hmueller/glib:gunicode-fix into main

The define for g_utf8_next_char(p) includes a not needed final cast to (char *). In fact, this cast has the adverse effect of causing a warning if p is a (const char *) with gcc/clang compiler option -Wcast-qual. So lets remove the not needed cast and add option -Werror=cast-qual to glib/tests/utf8-pointer.c which uses g_utf8_next_char(). Now utf8-pointer.c compiles also with compiler option -Werror=cast-qual and passes all tests.

Merge request reports