Wrong Gobject-Introspection GIR file annotations for null terminated string arrays
In file /opt/gtk/share/gir-1.0/Gdk-4.0.gir
<parameter name="mime_types" transfer-ownership="none">
<doc xml:space="preserve"
filename="../gdk/gdkclipboard.c"
line="638">a %NULL-terminated array of mime types to choose from</doc>
<type name="utf8" c:type="const char**"/>
</parameter>
Comment of Mr. Bassi:
Yes, the parameter is missing a (array zero-terminated=1) annotation. Please, file a bug.
See https://discourse.gnome.org/t/gdk-clipboard-read-async-mime-types-gir-issue/6957
Without that annotation language bindings generate wrong code, which is hard to fix manually.
You may look at annotations of functions like gtk_about_dialog_add_credit_section() to see an example for a correct annotation like
<parameter name="people" transfer-ownership="none">
<doc xml:space="preserve"
filename="../gtk/gtkaboutdialog.c"
line="2337">The people who belong to that section</doc>
<array c:type="const char**">
<type name="utf8" c:type="char*"/>
</array>
</parameter>
Please note that there are some more candidates for this issue, see
$ grep "type name=\"utf8\" c:type=\"const char\*\*\"/" /opt/gtk/share/gir-1.0/*
/opt/gtk/share/gir-1.0/Gdk-4.0.gir: <type name="utf8" c:type="const char**"/>
/opt/gtk/share/gir-1.0/Gdk-4.0.gir: <type name="utf8" c:type="const char**"/>
/opt/gtk/share/gir-1.0/Gdk-4.0.gir: <type name="utf8" c:type="const char**"/>
/opt/gtk/share/gir-1.0/GdkX11-4.0.gir: <type name="utf8" c:type="const char**"/>
/opt/gtk/share/gir-1.0/GdkX11-4.0.gir: <type name="utf8" c:type="const char**"/>
/opt/gtk/share/gir-1.0/Gtk-4.0.gir: <type name="utf8" c:type="const char**"/>
/opt/gtk/share/gir-1.0/Gtk-4.0.gir: <type name="utf8" c:type="const char**"/>
/opt/gtk/share/gir-1.0/Gtk-4.0.gir: <type name="utf8" c:type="const char**"/>
/opt/gtk/share/gir-1.0/Gtk-4.0.gir: <type name="utf8" c:type="const char**"/>
/opt/gtk/share/gir-1.0/Gtk-4.0.gir: <type name="utf8" c:type="const char**"/>
/opt/gtk/share/gir-1.0/Pango-1.0.gir: <type name="utf8" c:type="const char**"/>
/opt/gtk/share/gir-1.0/Pango-1.0.gir: <type name="utf8" c:type="const char**"/>
/opt/gtk/share/gir-1.0/Pango-1.0.gir: <type name="utf8" c:type="const char**"/>
/opt/gtk/share/gir-1.0/Pango-1.0.gir: <type name="utf8" c:type="const char**"/>
/opt/gtk/share/gir-1.0/Pango-1.0.gir: <type name="utf8" c:type="const char**"/>
/opt/gtk/share/gir-1.0/Pango-1.0.gir: <type name="utf8" c:type="const char**"/>
Some of that parameters are out parameters, so I am not really sure if they are wrong, but I think so. I guess you will know.