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 724432 - g-ir-scanner maps unsigned char* to guint8
g-ir-scanner maps unsigned char* to guint8
Status: RESOLVED OBSOLETE
Product: gobject-introspection
Classification: Platform
Component: g-ir-scanner
1.38.x
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-02-15 18:17 UTC by Jan Kümmel
Modified: 2018-02-08 12:26 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jan Kümmel 2014-02-15 18:17:16 UTC
g-ir-scanner (1.38.0) maps unsigned char* to guint8

I would have expected gpointer or something like that.

a header file containing the following line
void unsignedchar_test(unsigned char* data);

is transformed to this block:

    <function name="test" c:identifier="unsignedchar_test">
      <return-value transfer-ownership="none">
        <type name="none" c:type="void"/>
      </return-value>
      <parameters>
        <parameter name="data" transfer-ownership="none">
          <type name="guint8" c:type="unsigned char*"/>
        </parameter>
      </parameters>
    </function>
Comment 1 Simon Feltman 2014-08-20 02:29:37 UTC
While it is obviously wrong, I'm not sure what should be expected. Is this an out argument or is it an input buffer? Either case can be annotated explicitly:

/**
 * test_unsignedchar:
 * @data: (out caller-allocates):
 **/

or

/**
 * test_unsignedchar:
 * @data: (array zero-terminated=1):
 **/

See: https://wiki.gnome.org/Projects/GObjectIntrospection/Annotations

If anything I think the scanner should probably generate an error and skip the method due to the ambiguity.
Comment 2 André Klapper 2015-02-07 17:11:41 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:26:42 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/105.