Structures are generated in wrong order and cause 'field has incomplete type'
Submitted by mar..@..il.com
Link to original bug (#667510)
Description
Created attachment 204841 Structures that include each other
When the attached file is compiled, the generated order of C structures is wrong and val is incomplete. If the _xinnerstruct definition is moved to the top, compilation succeeds. Also the order of the C structures seems to be arbitrary, and it looks like it changes between compilations. valac doesn't report any errors, but cc fails.
(vala 0.14 & 0.15.0, gcc 4.6.1, linux 64bit)
//generated code struct _xTypeValue { gint type; xinnerstruct val; }; struct _xListItem { xListItem* next; xTypeValue tv; }; struct _xList { xListItem* first; xListItem* last; }; struct _xDictItem { xDictItem* next; xTypeValue tv; }; struct _xDict { xDictItem* first; xDictItem* last; }; struct _xinnerstruct { xList* a_list; xDict* a_dict; gchar* a_string; glong a_number; };
Attachment 204841, "Structures that include each other":
structs.vala
Version: 0.15.x