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 773980 - GIR scanner doesn't interpret array type properly
GIR scanner doesn't interpret array type properly
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2016-11-05 15:06 UTC by Marcin Kolny (IRC: loganek)
Modified: 2017-11-28 14:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gmountoperation: Add missing (array) annotations (1.58 KB, patch)
2017-11-15 10:55 UTC, Philip Withnall
committed Details | Review

Description Marcin Kolny (IRC: loganek) 2016-11-05 15:06:11 UTC
I've noticed this problem in GMountOperation (gio) class.

Signature of virtual method:
  void (* ask_question) (GMountOperation       *op,
			 const char            *message,
			 const char            *choices[]);

Gio-2.0.gir:
<parameter name="choices" transfer-ownership="none">
  <type name="utf8" c:type="const char*"/>
</parameter>

What means, that type of choices is const char*, but not const char*[]. I'd expect to have following nodes in GIR file:

<parameter name="choices" transfer-ownership="none">
  <array>
    <type name="utf8" c:type="const char*"/>
  </array>
</parameter>
Comment 1 Emmanuele Bassi (:ebassi) 2017-05-04 21:46:24 UTC
This needs an annotation to the virtual function in GIO → re-assigning.
Comment 2 Philip Withnall 2017-05-05 10:15:33 UTC
(In reply to Emmanuele Bassi (:ebassi) from comment #1)
> This needs an annotation to the virtual function in GIO → re-assigning.

Are you sure? Looks like a g-ir-scanner bug with handling `[]` array notation.
Comment 3 Philip Withnall 2017-11-15 10:55:40 UTC
Created attachment 363669 [details] [review]
gmountoperation: Add missing (array) annotations

Two of the vfuncs in GMountOperation need some annotations for their
element types and array sizes, otherwise g-ir-scanner comes up with
nonsense output.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Comment 4 Emmanuele Bassi (:ebassi) 2017-11-28 12:46:52 UTC
Review of attachment 363669 [details] [review]:

ACK-by: me
Comment 5 Philip Withnall 2017-11-28 14:15:03 UTC
Attachment 363669 [details] pushed as b16d7fc - gmountoperation: Add missing (array) annotations