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 676977 - invalid C code for array of nullable structs with initializer
invalid C code for array of nullable structs with initializer
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Arrays
0.16.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
invalid-c-code
Depends on:
Blocks:
 
 
Reported: 2012-05-28 16:17 UTC by Kerrick Staley
Modified: 2018-05-22 14:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The offending Vala code (390 bytes, application/octet-stream)
2012-05-28 16:17 UTC, Kerrick Staley
Details
The generated C code (546 bytes, text/x-csrc)
2012-05-28 16:18 UTC, Kerrick Staley
Details

Description Kerrick Staley 2012-05-28 16:17:29 UTC
Created attachment 215135 [details]
The offending Vala code

The attached Vala code won't compile. The offending snippet is
const OptionEntry?[] entries = { /* initializer */ };

valac exits with the error
error: cc exited with status 256

There are also many errors of the form
** (valac:6762): CRITICAL **: vala_ccode_function_add_assignment: assertion `self != NULL' failed

In the generated C code (also attached), you can see that the array "entries" is declared and initialized, but the individual elements of the array are never declared/initialized, so the C compiler gives the error
error: ‘_tmp0_’ undeclared here (not in a function)
Comment 1 Kerrick Staley 2012-05-28 16:18:26 UTC
Created attachment 215136 [details]
The generated C code

valac generates this from the array_of_nullable_structs_issue.vala file
Comment 2 GNOME Infrastructure Team 2018-05-22 14:25:41 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/vala/issues/303.