After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 737883 - zero-terminated annotation ignored for byte arrays
zero-terminated annotation ignored for byte arrays
Status: RESOLVED OBSOLETE
Product: gobject-introspection
Classification: Platform
Component: g-ir-scanner
2.42.x
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-10-04 12:36 UTC by Mikhail Zabaluev
Modified: 2018-02-08 12:30 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Mikhail Zabaluev 2014-10-04 12:36:56 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().
Comment 1 Mikhail Zabaluev 2014-10-04 12:39:38 UTC
(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.
Comment 2 André Klapper 2015-02-07 17:22:35 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
Comment 3 GNOME Infrastructure Team 2018-02-08 12:30:20 UTC
-- 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.