Assigning inline-allocated array with no size specified, with a new heap-allocated array passes valac but produces invalid C code
Vala code:
void main() {
int arr[] = new int[1];
}
Generated C code (invalid):
void
_vala_main (void)
{
gint arr[] = NULL;
gint* _tmp0_;
gint arr_length1;
gint _arr_size_;
_tmp0_ = g_new0 (gint, 1);
arr = _tmp0_;
arr_length1 = 1;
_arr_size_ = arr_length1;
arr = (g_free (arr), NULL);
}
Note that int arr[1] = new int[1];
produces valid C code gint arr[1] = {0};
.
I'm not sure what the expected outcome should be, since the Vala reference manual doesn't even mention inline arrays.