#include<stdio.h>
int main()
{
int x = 5;
int length = 5+x;
int arrayw[length];
return 0;
}
This code builds fine in gcc and Keil but not in IAR.
I get this error :
Error[Pe028]: expression must have a constant value
How can it be made to compile fine in IAR toolchain
On the step where it says Setting project options make sure to select C99.
Here is the window you're looking for:
P.S. There is also an option to explicitly allow VLA in IAR. See http://www.keil.com/support/man/docs/armcc/armcc_chr1359124950297.htm