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 434929 - length inference for returned value arrays
length inference for returned value arrays
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Arrays
0.0.x
Other All
: Normal normal
: ---
Assigned To: Jürg Billeter
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2007-05-01 16:16 UTC by Michael Lawrence
Modified: 2008-11-12 20:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Lawrence 2007-05-01 16:16:08 UTC
It would be great if methods could return arrays of value structs, hence avoiding this "error: arrays of value-type structs with no explicit length parameter are not supported"...

As far as I can tell there is no way to specify an explicit length parameter here, since it seems from looking at the compiler sources that returned arrays are not considered.

I ran into this trying to bind to the function g_type_children().
Comment 1 Michael Lawrence 2007-05-18 12:45:21 UTC
Just to clarify:
The limitation boils down to the inability to bind C functions that return an array of value types. This bug is what is really holding me back from using Vala, since I cannot bind to many libgsf functions that return uchar[].
Comment 2 Jürg Billeter 2007-06-05 09:26:04 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.

Vala assumes now that methods returning arrays return the array length via the last function argument. Methods not supporting this have to be annotated with the [NoArrayLength] attribute.
Comment 3 Marc-Andre Lureau 2008-10-18 15:53:43 UTC
Test case added in vala-tests, for the g_type_children() and string.split () calls.