GNOME Bugzilla – Bug 492481
needs "int[100] myarray;" syntax for direct allocation
Last modified: 2009-04-10 15:06:50 UTC
There's a need for directly embedding fixed-size arrays in struct/class or on the stack. Preferred syntax is: int[100] myarray;
Yes, this makes sense, in my opinion. It might be a bit problematic grammar-wise for local variables but it should be semantically conflict-free.
*** Bug 522003 has been marked as a duplicate of this bug. ***
Will it be possible to use int[some_function ()] myarray; for alloca call?
I've hit this problem as well. The lack of fixed-size stack arrays is a language deficiency that should be solved soon. It should not be impossible to cause Vala to generate basic C syntax such as "float Quaternion[4];".
commit e065e581748863cb7c90fabb2bb39d6671dfbe8f Author: Jürg Billeter <j@bitron.ch> Date: Fri Apr 10 17:02:22 2009 +0200 Arrays: Add experimental support for fixed-length arrays Local fixed-length arrays are allocated on the stack. int[3] array = { 1, 2, 3 }; Fixes bug 492481.