GNOME Bugzilla – Bug 737883
zero-terminated annotation ignored for byte arrays
Last modified: 2018-02-08 12:30:20 UTC
In cases where it's necessary to avoid the blanket typecasting of byte string pointers as `utf8` in introspection, the following annotation is used: (array zero-terminated=1) (element-type guint8) It can be seen on parameters of g_spawn_command_line_sync(), and it really should be used in many other places. Unfortunately, gobject-introspection currently eats the zero-terminated flag on arrays of guint8 or gchar, emitting a not-so-useful description of an array type of unknown length. Oddly, zero-terminated is preserved when accompanied with a length parameter, like on g_variant_dup_bytestring().
(In reply to comment #0) > In cases where it's necessary to avoid the blanket typecasting of byte string > pointers as `utf8` in introspection, the following annotation is used: > (array zero-terminated=1) (element-type guint8) BTW, that would look much more concise as (type bytestring). A bytestring type would also fix the annotations on argv and envp parameters in g_spawn_* and the like.
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gobject-introspection/issues/116.