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 793273 - Missing array length introspection annotation for vte_terminal_feed_child
Missing array length introspection annotation for vte_terminal_feed_child
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: VTE Maintainers
VTE Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-02-07 19:13 UTC by Phil Clayton
Modified: 2018-03-03 12:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix annotation for vte_terminal_feed_child (925 bytes, patch)
2018-02-07 23:35 UTC, Phil Clayton
accepted-commit_now Details | Review

Description Phil Clayton 2018-02-07 19:13:57 UTC
vte_terminal_feed_child does not have an array length introspection annotation, unlike vte_terminal_feed_child_binary.  Therefore bindings to vte_terminal_feed_child in other languages will need to specify the length or -1 if it is known that the language bindings supply a zero-terminated string to the C function.

I can't think of a benefit to language bindings - is no length annotation intentional?
Comment 1 Christian Persch 2018-02-07 20:34:14 UTC
Not intentional, no.

(However this function is rarely needed; what are you using it for?)
Comment 2 Phil Clayton 2018-02-07 23:32:23 UTC
I have a mini text editor with a VTE widget built-in that runs a REPL (of a Standard ML compiler, FWIW).  As well as using vte_terminal_paste_primary to evaluate selected text in the REPL, I use vte_terminal_feed_child to send the string ";\n" to the REPL, which is useful to force top-level declarations to be evaluated.
Comment 3 Phil Clayton 2018-02-07 23:35:52 UTC
Created attachment 368105 [details] [review]
Fix annotation for vte_terminal_feed_child

Patch in case it's useful.
Comment 4 Christian Persch 2018-02-08 08:30:29 UTC
Comment on attachment 368105 [details] [review]
Fix annotation for vte_terminal_feed_child

(element-type gchar) 

Why change that from utf-8 (which is what's required by this function) ?
Comment 5 Phil Clayton 2018-02-08 09:32:42 UTC
We would have (element-type utf8) if the elements of the container type (in this case, array) were strings.  For this function, text is just a string which is an array of chars.

I suspect the (element-type utf8) annotation was being ignored before because there was no container type or (array ...) annotation.
Comment 6 Phil Clayton 2018-02-08 09:37:37 UTC
In fact, the patch causes the following GISCAN warning to disappear:

src/vtegtk.cc:2630: Warning: Vte: Unknown container Type(target_fundamental=utf8, ctype=char*) for element-type annotation

(I am testing the patch on top of 0.51.1)