This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to use variable length array in keil

I want to port an opensource project using winavr to keil mdk, but keil throw warning:
#1271-D: variable-length array field type will be treated as zero-length array field type
And when I debug in program, some variable array mixed with some other variable in address, this cause the program fail. So how to port project that use variable array ?

Chris

Parents
  • So does keil support true vla support or it is just a 0 length array? Why here the defined vla mixed with other variable defined in the same function? As I know, the vla area is located in the stack, but i think keil should trace the length of array and should not be mixed with other varible defined in this function, am i right?
    If it is just a 0 length array, I think I should just use vla as the last defined variable in this function.

    Chris

Reply
  • So does keil support true vla support or it is just a 0 length array? Why here the defined vla mixed with other variable defined in the same function? As I know, the vla area is located in the stack, but i think keil should trace the length of array and should not be mixed with other varible defined in this function, am i right?
    If it is just a 0 length array, I think I should just use vla as the last defined variable in this function.

    Chris

Children