In general, GLib’s purpose is a utility and portability library. Those in itself are reasons to consider using it.
The specific functions you mention all offer something extra on top of their C standard library variants:
g_strdup_printf
is likesprintf
, but actually allocates the buffer for you and saves you the guesswork of how large the buffer should be. (The return value should beg_free
‘d.)g_free
is likefree
, but checks for a NULL-pointer.g_strcmp0
is likestrcmp
, but treats a NULL-pointer like an empty string, and thus sorts it in front.