Make g_string_free (_, FALSE) warn on unused result
Use some macro magic, in particular __builtin_constant_p ()
, to make it so that g_string_free ()
behaves as if it was declared with G_GNUC_WARN_UNUSED_RESULT
when passed free_segment = FALSE
(compile-time constant), and without it otherwise.
Silence the few warnings (all benign!) that this change has uncovered in GLib's own codebase.
Discussed with @ebassi and @matthiasc on Matrix/IRC.
Also while nobody's looking, sneak in a couple of tiny fixes to make GLib cleanly build on the Hurd again.