Skip to content

gstrfuncs: Add missing (transfer none) annotations for several funcs

Philip Withnall requested to merge pwithnall/glib:3286-strfuncs-annotations into main

These unfortunately have gchar* return types rather than const gchar*. This is a historical artifact which we can’t change: while adding const would only be an API break and not an ABI break, it would cause all sorts of C++ code which uses GLib to emit new cast warnings (similarly, C code with const correctness compiler warnings enabled would do the same).

The incorrect return type causes the GIR scanner to (reasonably) assume the return value is allocated, which is wrong.

Fix that by explicitly adding (transfer none).

Also add an explicit (nullable) because all three functions are.

Signed-off-by: Philip Withnall Fixes: #3286 (closed)

Closes #3286 (closed)

Merge request reports